GithubHelp home page GithubHelp logo

Comments (6)

rbodo avatar rbodo commented on July 20, 2024

@jackyfaster Sorry for the delay, I'm travelling at the moment, will get the chance to take a look some time next week.

from snn_toolbox.

jackyfaster avatar jackyfaster commented on July 20, 2024

@rbodo Nice, I'm waiting for your message.

from snn_toolbox.

rbodo avatar rbodo commented on July 20, 2024

When you say "BinaryNet", are you referring to binarizing both weights and activations, using the framework of Mathieu Courbariaux? If so, #33 might be related.

But I see you are using keras and tensorflow in your config file, so it seems you binarized the network yourself? What kind of binarization function are you using for the activations? binary_tanh for [-1, 1], or binary_sigmoid for [0, 1], or something else?

Some things to check / try:

  • Inspect the _INI.h5 file which the toolbox saves and make sure the weights are indeed binarized as desired.
  • Increase the simulation duration
  • Use "Reset by subtraction" instead of "Reset to zero"
  • Enable output plots by setting plot_vars = {'all'} in section [output] of your config file. Then compare the ANN activations and the SNN spikerates. This should give you an idea where the SNN diverges from the ANN.
  • Does your model use a MaxPooling layer? They might cause some drop in accuracy when converted to spiking, but not that much.
  • You are probably using softmax as output activation function. Try setting softmax_to_relu = True in the [conversion] section.

from snn_toolbox.

jackyfaster avatar jackyfaster commented on July 20, 2024

@rbodo Hi,
I binarized both weights and activations myself, and i used binary_tanh[-1, 1] binarization function.
thanks for your suggestions much, i will try.

from snn_toolbox.

jackyfaster avatar jackyfaster commented on July 20, 2024

@rbodo hi,

i am sorry to bother you again,
i changed the binarization function from binary_tanh to binary_sigmoid, the box works well. thanks for your suggestions again!
and i want to ask a question more, i run a same ANN model in the box, not only one time, i got the different results as the following:

one result

Batch 2 of 2 completed (100.0%)
Moving accuracy of SNN (top-1, top-5): 93.00%, 100.00%.
Moving accuracy of ANN (top-1, top-5): 91.00%, 100.00%.
Simulation finished.

another result

Batch 2 of 2 completed (100.0%)
Moving accuracy of SNN (top-1, top-5): 91.00%, 100.00%.
Moving accuracy of ANN (top-1, top-5): 91.00%, 100.00%.
Simulation finished.

I would be grateful if you could give me some advice.

from snn_toolbox.

rbodo avatar rbodo commented on July 20, 2024

Just to clarify: The network in both cases is the same?

Also, I assume you made sure that the samples in the 2 batches are the same in both cases.

Then you need to make sure that the binarization functions you use are deterministic. Go to the script snntoolbox/utils/utils.py and have a look at the various binarization functions. They expose the argument deterministic, which is True by default. If you use any of them, check that this parameter is not maybe set to False.

Finally, you could find out which two samples were misclassified in the second case. Then plot the spikerates, correlations etc for these two samples, and see whether / how they change when you run it again.

from snn_toolbox.

Related Issues (20)

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.