Giter VIP home page Giter VIP logo

Comments (11)

rbodo avatar rbodo commented on May 16, 2024

Based on the error message, please add the following to the config dict:

config['cell'] = {
    'tau_refrac': 1               # Refractory period must be at least one time step.
}

Let me know if that solves the issue (I have no access to a nest installation at the moment).

from snn_toolbox.

dizcza avatar dizcza commented on May 16, 2024

Then I got

Building spiking model...
Building layer: 00Conv2D_12x12x16
NEST does not allow setting an initial value for isyn_exc
NEST does not allow setting an initial value for isyn_inh
Transposing kernels.
/home/dizcza/anaconda3/envs/snn_toolbox-conda/lib/python3.7/site-packages/keras/utils/conv_utils.py:82: FutureWarning:Using a non-tuple sequence for multidimensional indexing is deprecated; use `arr[tuple(seq)]` instead of `arr[seq]`. In the future this will be interpreted as an array index, `arr[np.array(seq)]`, which will result either in an error or a different result.
................
Traceback (most recent call last):
  File "/home/dizcza/anaconda3/envs/snn_toolbox-conda/lib/python3.7/site-packages/PyNN-0.9.5.dev0-py3.7.egg/pyNN/nest/projections.py", line 173, in _convergent_connect
    syn_dict)
  File "/home/dizcza/anaconda3/envs/snn_toolbox-conda/lib/python3.7/site-packages/nest/ll_api.py", line 246, in stack_checker_func
    return f(*args, **kwargs)
  File "/home/dizcza/anaconda3/envs/snn_toolbox-conda/lib/python3.7/site-packages/nest/lib/hl_api_connections.py", line 362, in Connect
    sr('Connect')
  File "/home/dizcza/anaconda3/envs/snn_toolbox-conda/lib/python3.7/site-packages/nest/ll_api.py", line 132, in catching_sli_run
    raise exceptionCls(commandname, message)
nest.ll_api.BadDelay: ('BadDelay in Connect_g_g_D_D: Delay value 0 is invalid: Delay must be greater than or equal to resolution', 'BadDelay', <SLILiteral: Connect_g_g_D_D>, ': Delay value 0 is invalid: Delay must be greater than or equal to resolution')

During handling of the above exception, another exception occurred:

Traceback (most recent call last):
  File "examples/mnist_keras_nest.py", line 153, in <module>
    main(config_filepath)
  File "/home/dizcza/PycharmProjects/other/snn_toolbox/snntoolbox/bin/run.py", line 31, in main
    run_pipeline(config)
  File "/home/dizcza/PycharmProjects/other/snn_toolbox/snntoolbox/bin/utils.py", line 129, in run_pipeline
    spiking_model.build(parsed_model, **testset)
  File "/home/dizcza/PycharmProjects/other/snn_toolbox/snntoolbox/simulation/utils.py", line 441, in build
    self.build_convolution(layer)
  File "/home/dizcza/PycharmProjects/other/snn_toolbox/snntoolbox/simulation/target_simulators/pyNN_target_sim.py", line 155, in build_convolution
    self.sim.FromListConnector(connections, ['weight', 'delay'])))
  File "/home/dizcza/anaconda3/envs/snn_toolbox-conda/lib/python3.7/site-packages/PyNN-0.9.5.dev0-py3.7.egg/pyNN/nest/projections.py", line 59, in __init__
    connector.connect(self)
  File "/home/dizcza/anaconda3/envs/snn_toolbox-conda/lib/python3.7/site-packages/PyNN-0.9.5.dev0-py3.7.egg/pyNN/connectors.py", line 546, in connect
    projection._convergent_connect(sources, tgt, **connection_parameters)
  File "/home/dizcza/anaconda3/envs/snn_toolbox-conda/lib/python3.7/site-packages/PyNN-0.9.5.dev0-py3.7.egg/pyNN/nest/projections.py", line 178, in _convergent_connect
    raise errors.ConnectionError(errmsg)
pyNN.errors.ConnectionError: ('BadDelay in Connect_g_g_D_D: Delay value 0 is invalid: Delay must be greater than or equal to resolution', 'BadDelay', <SLILiteral: Connect_g_g_D_D>, ': Delay value 0 is invalid: Delay must be greater than or equal to resolution'). presynaptic_cells=[787 903 902 901 900 899 875 873 872 871 847 846 874 844 845 789 790 791
 815 788 817 818 819 843 816], postsynaptic_cell=1573, weights=[[  47.00486362 -149.68934655  -49.93713275   -2.76117749   46.6363579
    90.42757004 -149.20666814   90.95539153  100.26297718  106.19264096
  -122.27715552  -64.65259939  -29.49396148   90.83072841   32.23535791
   122.6894781    63.53992224  -83.09756219   21.30669169   22.91868255
    61.9224906   -60.5805926   -85.03986895   82.16306567   42.93421656]], delays=[[0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.
  0.]], synapse model='static_synapse_lbl'

I fixed with config['cell']['delay'] = 1 but I'm not sure if I'm doing right here. Because when I run the example, it works but always outputs 0% accuracy, 100% error, no spikes... In the end, it printed

Total accuracy: 0.00% on 5 test samples.
Accuracy averaged by class size: 50.00%

from snn_toolbox.

rbodo avatar rbodo commented on May 16, 2024

Try reducing the simulation time step and increasing the duration:

[simulation]
dt = 0.1
duration = 200

Likewise set the delay and refractory period to 0.1.

If that does not help, it's probably an incompatibility with the new Nest version. I will not be able to look at this until end of January. Your other option in that case is to roll back your Nest version.

Please let me know what you get.

from snn_toolbox.

dizcza avatar dizcza commented on May 16, 2024

Which version of NEST did you test?

from snn_toolbox.

rbodo avatar rbodo commented on May 16, 2024

2.14.0

from snn_toolbox.

dizcza avatar dizcza commented on May 16, 2024

And what is pyNN version? I get different errors, depending on which pyNN I use with NEST 2.14.

from snn_toolbox.

rbodo avatar rbodo commented on May 16, 2024

Don't know, sorry. Have no way of checking it right now and it's been too long ago to remember.

I take it decreasing the time resolution / increasing the duration did not help?

from snn_toolbox.

dizcza avatar dizcza commented on May 16, 2024

Yes, it didn't help - still 0% accuracy.

from snn_toolbox.

meltingCat avatar meltingCat commented on May 16, 2024

@dizcza where did you add config['cell']['delay'] = 1 ?

from snn_toolbox.

dizcza avatar dizcza commented on May 16, 2024

@meltingCat
I followed these instructions

Based on the error message, please add the following to the config dict:

config['cell'] = {
    'tau_refrac': 1               # Refractory period must be at least one time step.
}

in mnist_keras_nest.py

from snn_toolbox.

rbodo avatar rbodo commented on May 16, 2024

OK, finally got a chance to run it myself. The trick is to simply lower the threshold to get more spikes. (There is even a message to that effect printed somewhere in the toolbox output, but it can admittedly be a bit buried...)
I updated the Nest example with working parameters.

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.