jiecaoyu / XNOR-Net-PyTorch

PyTorch Implementation of XNOR-Net
472 stars 119 forks source link

Binary Convolution #104

Closed kannan500 closed 4 years ago

kannan500 commented 4 years ago

I was doing Binary Convolution without using Conv2d function. I used the weights printed from model.named_parameter() and to binarize that, I just took the sign of those weights.Then I took the output of BinActive function and did convolution with those binarized weights.Then I multiplied the convolution result with alpha. But the output of my code and the printed output of your code were not matching. Can you tell me, if I missed something?? Why the results were not matching??

kannan500 commented 4 years ago

I was doing XNOR operation with those inputs and weights.Thats why I was getting wrong results.If I am doing normal convolution, its matching.

PS: I have converted all binary values in [-1 +1] form to [0 +1] for XNOR,,but its not giving correct results.Dont know Why??