Code Monkey home page Code Monkey logo

Comments (2)

Jiaolong avatar Jiaolong commented on July 2, 2024

Thanks for your comments. This code is experimental and there were numerous bugs. I just fixed some of them. Now BWN should be around 97% and XNOR around 96%.

Regarding to the alpha issue, it is indeed computed in the forward and backward of BinaryConvolution layer but not in the BinaryActivation layer. The scale factor of the binary inputs is not considered in this code, which is the parameter beta in equation (10) of the XNOR-Net paper. If you included beta, it should produce better results.

from xnor-net.

Jiaolong avatar Jiaolong commented on July 2, 2024

Just updated it again! With Adam optimizer and lr=0.0002, the results are better.

python main.py --network=mnist_xnor
Namespace(batch_size=100, data_path='../data/MNIST_data/', learning_rate=0.1, momentum=0.9, network='mnist_xnor', num_epoch=5)
INFO:root:Epoch[0] Batch [200]	Speed: 2333.27 samples/sec	accuracy=0.893284
INFO:root:Epoch[0] Batch [400]	Speed: 2348.61 samples/sec	accuracy=0.973850
INFO:root:Epoch[0] Train-accuracy=0.976533
INFO:root:Epoch[0] Time cost=25.585
INFO:root:Epoch[0] Validation-accuracy=0.979300
INFO:root:Epoch[1] Batch [200]	Speed: 2370.62 samples/sec	accuracy=0.979751
INFO:root:Epoch[1] Batch [400]	Speed: 2381.95 samples/sec	accuracy=0.983550
INFO:root:Epoch[1] Train-accuracy=0.982764
INFO:root:Epoch[1] Time cost=25.247
INFO:root:Epoch[1] Validation-accuracy=0.980700
INFO:root:Epoch[2] Batch [200]	Speed: 2384.56 samples/sec	accuracy=0.982736
INFO:root:Epoch[2] Batch [400]	Speed: 2369.69 samples/sec	accuracy=0.985950
INFO:root:Epoch[2] Train-accuracy=0.984472
INFO:root:Epoch[2] Time cost=25.245
INFO:root:Epoch[2] Validation-accuracy=0.982100
INFO:root:Epoch[3] Batch [200]	Speed: 2362.13 samples/sec	accuracy=0.985920
INFO:root:Epoch[3] Batch [400]	Speed: 2351.47 samples/sec	accuracy=0.987700
INFO:root:Epoch[3] Train-accuracy=0.986834
INFO:root:Epoch[3] Time cost=25.455
INFO:root:Epoch[3] Validation-accuracy=0.980200
INFO:root:Epoch[4] Batch [200]	Speed: 2355.15 samples/sec	accuracy=0.986169
INFO:root:Epoch[4] Batch [400]	Speed: 2338.48 samples/sec	accuracy=0.987750
INFO:root:Epoch[4] Train-accuracy=0.988342
INFO:root:Epoch[4] Time cost=25.685
INFO:root:Epoch[4] Validation-accuracy=0.982600
Testing accuracy: 98.26%

from xnor-net.

Related Issues (2)

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.