DingKe / nn_playground

Experimental keras implementation of novel neural network structures
MIT License
430 stars 152 forks source link

binarynet weights are not binary after trained #3

Closed wangdelp closed 7 years ago

wangdelp commented 7 years ago

Hi,

I thought we should expect the weights are binary after we train the binary net, is that right? But after run the mnist_cnn.py, and output the weights by model.get_weights(), the weights are still floating point numbers. Is this a bug? Thank you.

DingKe commented 7 years ago

The code is for training only. You can manually binarize the weights after training. Hope it could help you.

wangdelp commented 7 years ago

I see. So I guess for the evaluation, it would make more sense to use the binarized weights rather than the floating weights, since this binarization process might lose some accuracy, right?

Haosam commented 6 years ago

Are the weights supposed to be binarized? I thought according to the paper, the weights are only binarized during forward propagation. During backward propagation, the updated weights are not binarized anymore?