GithubHelp home page GithubHelp logo

Comments (1)

rbodo avatar rbodo commented on July 2, 2024

Hi,

I just tried to run this myself again. Unfortunately, the old keras model I used for the paper does not work any more because of incompatibilities with more recent versions of keras/tf. So I had to train the model from scratch. After applying the TTFS conversion, I got a drop in accuracy of about 4.7 percentage points when going from ANN to SNN. That's clearly larger than the 2% reported in the paper, but not so large that I would suspect a bug. Might just be that the current training resulted in a larger proportion of low activations (i.e. late spikes), which are a source of error in the plain TTFS code.

Here's the configuration I used:

[paths]
path_wd = ./Data/snn_conversion/mnist/cnn/lenet5/keras/32bit
dataset_path = ./Datasets/mnist/cnn
filename_ann = mnist_cnn

[normalization]
percentile = 100

[conversion]
softmax_to_relu = True
spike_code = ttfs

[simulation]
duration = 50
dt = 0.1
num_to_test = 10000
batch_size = 50

The only important difference to a run with normal rate code is that we choose a higher time resolution (dt = 0.1 instead of 1), because we rely on fine temporal precision here. Also, it may be beneficial to replace the softmax by a relu (softmax_to_relu = True) because softmax in TTFS can only approximate the ANN softmax. ReLU is a safe choice as long as not all output neurons have a negative pre-activation (in which case there would be no spikes even though the softmax would be non-zero).

If the configuration above does not close the gap sufficiently, you may want to try one of the TTFS code variants or train the network with low activations clamped to zero (which should give the best results).

For an example of a temporal_mean_rate config, see here.

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.