hpi-xnor / BMXNet

(New version is out: https://github.com/hpi-xnor/BMXNet-v2) BMXNet: An Open-Source Binary Neural Network Implementation Based on MXNet
Apache License 2.0
349 stars 95 forks source link

Some things to document #31

Closed analog-cbarber closed 5 years ago

analog-cbarber commented 6 years ago

The documentation for the various Q* operators omits many details. Some points that should be described include:

I assume similar considerations apply to QConvolution.

yanghaojin commented 6 years ago

yes, this implementation is according to the 3 reference paper: "BNN-Net", "DoReFa-Net" and "XNOR-Net", so the quantization for > 1bit we follow the DoReFa-Net solution, the detailed description like value ranges of each case can be found in their paper. But for the 1-bit binarization we put some our own idea into the design of QConv and Qfc layers, for example the reason why we scale the output value from [-#inputs,+#inputs] to [0,#inputs] when both input and weights are in 1 bit. We describe those details in our paper . However I understand not every developer would like to take time to read research papers before they try out the code, it would be nice to get those insights directily by reading the documentation. We will try to optimize this in the souce code and the docu. Thanks for pointing out this.

analog-cbarber commented 6 years ago

I have read all three of those papers and it even so it would not be at all clear how exactly these details would manifest themselves in the API. It is always good practice to document all behavior in the API documentation - the rationale for the design can remain in the papers or in other high-level documentation. (BTW, the mainline MXNet documentation is itself overly sparse. I would not use their documentation as a model for good practice.)

yanghaojin commented 6 years ago

agree with u