BinaryNet_and_XNORNet icon indicating copy to clipboard operation
BinaryNet_and_XNORNet copied to clipboard

BinaryNetConv2D

Open mamba36 opened this issue 4 years ago • 5 comments

Why is the value of feature map after the BinaryNetConv2D layer not integer? The result of the convolution between binarized weights and binarized input should be integer. But when I run your code, I find that the feature maps is all decimals.

mamba36 avatar Jul 11 '20 05:07 mamba36

For backprop to work, training needs to be done in float precision

yaysummeriscoming avatar Jul 11 '20 08:07 yaysummeriscoming

For backprop to work, training needs to be done in float precision

Thank you very much for your answer.But my problem is in the feedforward phase。The features and weights are both binary, the convolution result should be integer, but I'll run your code to see that the intermediate result is floating point. The image shows the binary_net_conv2d_2 layer's features. Its supposed to be an integer. 图片

mamba36 avatar Jul 18 '20 16:07 mamba36

Yes, but the forward pass also needs to be done in float precision for backprop to work. For binary inference, you'll need to use another software package.

yaysummeriscoming avatar Jul 20 '20 13:07 yaysummeriscoming

Can you tell me which package I should use?

 

------------------ 原始邮件 ------------------ 发件人: "yaysummeriscoming/BinaryNet_and_XNORNet" <[email protected]>; 发送时间: 2020年7月20日(星期一) 晚上9:37 收件人: "yaysummeriscoming/BinaryNet_and_XNORNet"<[email protected]>; 抄送: "mamba36"<[email protected]>;"Author"<[email protected]>; 主题: Re: [yaysummeriscoming/BinaryNet_and_XNORNet] BinaryNetConv2D (#5)

Yes, but the forward pass also needs to be done in float precision for backprop to work. For binary inference, you'll need to use another software package.

— You are receiving this because you authored the thread. Reply to this email directly, view it on GitHub, or unsubscribe.

mamba36 avatar Jul 20 '20 13:07 mamba36

Unfortunately I haven't kept up to date with the latest developments in binary networks - it's been a few years since I made this. That being said, I've heard that plumerai & mxnet have packages available

yaysummeriscoming avatar Jul 20 '20 13:07 yaysummeriscoming