rethinking-bnn-optimization
rethinking-bnn-optimization copied to clipboard
kernel_initializer="glorot_normal"
In birealnet.py, I observe that kernel_initializer is set as "glorot_normal" for Conv2d; However, in QuantConv2D, the kernel_initializer is set as "glorot_normal". Kernel_initializer ="glorot_normal" means the kernel weights are all set as 1 ?
Thank you very much.
Glorot normal draws samples from a truncated normal distribution centered on 0, so in this case it means binary weights will be randomly set to either -1 or 1.
Thank you very much. I still have one more doubt. Are both Conv2d and QuantConv2D all set to either -1 or 1?
Are both Conv2d and QuantConv2D all set to either -1 or 1?
Only weights of QuantConv2D layers will be binarized.
My problem is that I found that the weights of QuantConv2D obtained with initialization method "glorot_normal" is not +1 or -1.
"glorot_normal" in Pytorch framework is as below:

The example is as :

The value of w is apparently not +1 or -1.
Thank you very much.