liuzechun / Bi-Real-net

Bi-Real Net: Enhancing the Performance of 1-bit CNNs With Improved Representational Capability and Advanced Training Algorithm. In ECCV 2018 and IJCV
176 stars 39 forks source link

输出权重为什么不是二值化的 #4

Open feifanzui opened 5 years ago

feifanzui commented 5 years ago

我用python输出了训练得到的model,为什么权重都是小数,不是+1 -1 啊

liuzechun commented 5 years ago

You need to set the weights to -1 and 1 in the convolution layers and also freeze the learning rate. Then you retrain the BatchNorm layer to absorb the scaling factor.

Lovegood-1 commented 3 years ago

You need to set the weights to -1 and 1 in the convolution layers and also freeze the learning rate. Then you retrain the BatchNorm layer to absorb the scaling factor.

excuse me, is what you said had been included in your code?

lihengxia commented 2 years ago

You need to set the weights to -1 and 1 in the convolution layers and also freeze the learning rate. Then you retrain the BatchNorm layer to absorb the scaling factor.

How to constraint the weights to -1 and 1?And, how to retrain the BatchNorm layer to absorb the scaling factor?