Giter Club home page Giter Club logo

Comments (8)

johannesthiele-cea avatar johannesthiele-cea commented on August 24, 2024

Hello,

I updated the Environment class so that it is possible to either convert a static dataset or use a AER dataset. You can compare the models mnist-stdp.ini and mnist-stdp-NMNIST.ini to see how this is done for the MNIST and NMNIST dataset.s

In general, you have to write your own driver if you want to include a dataset. A driver is a module that manages the training and test partition and how the dataset is read from the raw data. How this is done can be seen in the classes src/Database/MNIST_IDX_Database.cpp, src/Generator/MNIST_IDX_DatabaseGenerator.cpp (and the respective versions for NMNIST).

from n2d2.

vankhoa21991 avatar vankhoa21991 commented on August 24, 2024

Hello, I ran into this error while launching the mnist-stdpNMNIST.ini . I think the data is good, so it could be a problem in the code.

/n2d2 "mnist-stdp-NMNIST.ini" -learn 500000 -log 10000...
Option -log: number of steps between logs [10000]
Option -learn: number of backprop learning steps [500000]
Loading network configuration file mnist-stdp-NMNIST.ini
Layer: fc1 [Fc(Spike_Analog)]
Notice: Could not open configuration file: fc1.cfg

Synapses: 115650

Inputs dims: 34 34 2

Outputs dims: 1 1 50

Target: fc1 (target value: 1 / default value: 0 / top-n value: 1)
Total number of neurons: 50
Total number of nodes: 50
Total number of synapses: 115650
Total number of virtual synapses: 115650
Total number of connections: 115650
Notice: Unused section fc1.Target in INI file
Notice: Unused section common.config in INI file
Notice: Unused section common_Spike_RRAM.config in INI file
Learning database size: 30000 images
Validation database size: 30000 images
Testing database size: 10000 images
[LOG] Stimuli transformations flow (transformations.png)
sh: 1: dot: not found
[LOG] Network graph (mnist-stdp-NMNIST.ini.png)
[LOG] Network SVG graph (mnist-stdp-NMNIST.ini.svg)
sh: 1: dot: not found
[LOG] Network stats (stats/)
[LOG] Solvers scheduling (schedule/
)
[LOG] Layer's receptive fields (receptive_fields.log)
[LOG] Labels mapping (.Target/labels_mapping.log)
[LOG] Labels legend (
.Target/labels_legend.png)
Warning: empty y range [115650:115650], adjusting to [114494:116806]
Warning: empty cb range [115650:115650], adjusting to [114494:116806]
Warning: empty y range [115650:115650], adjusting to [114494:116806]
Warning: empty cb range [115650:115650], adjusting to [114494:116806]
Warning: empty y range [100:100], adjusting to [99:101]
Warning: empty cb range [100:100], adjusting to [99:101]
Warning: empty y range [50:50], adjusting to [49.5:50.5]
Warning: empty cb range [50:50], adjusting to [49.5:50.5]
Warning: empty y range [100:100], adjusting to [99:101]
Warning: empty cb range [100:100], adjusting to [99:101]
Warning: empty y range [115650:115650], adjusting to [114494:116806]
Warning: empty cb range [115650:115650], adjusting to [114494:116806]
Warning: empty y range [100:100], adjusting to [99:101]
Warning: empty cb range [100:100], adjusting to [99:101]
Warning: empty y range [115650:115650], adjusting to [114494:116806]
Warning: empty cb range [115650:115650], adjusting to [114494:116806]
Warning: empty y range [100:100], adjusting to [99:101]
Warning: empty cb range [100:100], adjusting to [99:101]
Warning: empty y range [50:50], adjusting to [49.5:50.5]
Warning: empty cb range [50:50], adjusting to [49.5:50.5]
Warning: empty y range [100:100], adjusting to [99:101]
Warning: empty cb range [100:100], adjusting to [99:101]
Warning: empty y range [100:100], adjusting to [99:101]
Warning: empty cb range [100:100], adjusting to [99:101]
line 0: Can't plot with an empty x range!

Invalid registrar key "bin"
terminate called after throwing an instance of 'std::bad_function_call'
what(): bad_function_call
10:12:25: The program has unexpectedly finished.

from n2d2.

vankhoa21991 avatar vankhoa21991 commented on August 24, 2024

I found the answer, have to use -learn-stdp instead.

from n2d2.

vankhoa21991 avatar vankhoa21991 commented on August 24, 2024

Hello, I tried this example, and the acc reach ~72%
/n2d2 ../../../models/mnist-stdp.ini -learn-stdp 100000 -log 10000

But when I want to test the model, it demain the folder 'weights' and 'weights_range_normalized', when I only have the weights-init and weights-stdp instead.
Do you have any idea about this? Thanks

from n2d2.

davidbriand-cea avatar davidbriand-cea commented on August 24, 2024

Hello,
I think you have to specify the folder "weights-stdp" for testing :
./n2d2 ../../../models/mnist-stdp.ini -w weights-stdp -test

from n2d2.

vankhoa21991 avatar vankhoa21991 commented on August 24, 2024

Hello, it demands always the weights_range directory

/n2d2 ../../../models/mnist-stdp.ini -w weights-stdp -test
Option -test: perform testing
Option -w: start with weights imported from a specified location (even when loading a previously saved state) [weights-stdp]
Loading network configuration file ../../../models/mnist-stdp.ini
Layer: fc1 [Fc(Spike_Analog)]
Notice: Could not open configuration file: fc1.cfg

Synapses: 39250

Inputs dims: 28 28 1

Outputs dims: 1 1 50

Target: fc1 (target value: 1 / default value: 0 / top-n value: 1)
Total number of neurons: 50
Total number of nodes: 50
Total number of synapses: 39250
Total number of virtual synapses: 39250
Total number of connections: 39250
Notice: Unused section fc1.Target in INI file
Notice: Unused section common.config in INI file
Notice: Unused section common_Spike_RRAM.config in INI file
Learning database size: 60000 images
Validation database size: 0 images
Testing database size: 10000 images
[LOG] Stimuli transformations flow (transformations.png)
[LOG] Network graph (mnist-stdp.ini.png)
sh: 1: dot: not found
[LOG] Network SVG graph (mnist-stdp.ini.svg)
sh: 1: dot: not found
[LOG] Network stats (stats/)
[LOG] Solvers scheduling (schedule/
)
[LOG] Layer's receptive fields (receptive_fields.log)
[LOG] Labels mapping (.Target/labels_mapping.log)
[LOG] Labels legend (
.Target/labels_legend.png)
Warning: empty y range [39250:39250], adjusting to [38857.5:39642.5]
Warning: empty y range [100:100], adjusting to [99:101]
Warning: empty cb range [39250:39250], adjusting to [38857.5:39642.5]
Warning: empty cb range [100:100], adjusting to [99:101]
Warning: empty y range [39250:39250], adjusting to [38857.5:39642.5]
Warning: empty y range [39250:39250], adjusting to [38857.5:39642.5]
Warning: empty cb range [39250:39250], adjusting to [38857.5:39642.5]
Warning: empty cb range [39250:39250], adjusting to [38857.5:39642.5]
Warning: empty y range [100:100], adjusting to [99:101]
Warning: empty cb range [100:100], adjusting to [99:101]
Warning: empty y range [100:100], adjusting to [99:101]
Warning: empty cb range [100:100], adjusting to [99:101]
Warning: empty y range [50:50], adjusting to [49.5:50.5]
Warning: empty cb range [50:50], adjusting to [49.5:50.5]
Warning: empty y range [100:100], adjusting to [99:101]
Warning: empty cb range [100:100], adjusting to [99:101]
Warning: empty y range [100:100], adjusting to [99:101]
Warning: empty cb range [100:100], adjusting to [99:101]
Warning: empty y range [39250:39250], adjusting to [38857.5:39642.5]
Warning: empty cb range [39250:39250], adjusting to [38857.5:39642.5]
Warning: empty y range [100:100], adjusting to [99:101]
Warning: empty cb range [100:100], adjusting to [99:101]
Warning: empty y range [50:50], adjusting to [49.5:50.5]
Warning: empty cb range [50:50], adjusting to [49.5:50.5]
line 0: Can't plot with an empty x range!

Importing weights from directory 'weights-stdp'.
Notice: Could not open synaptic file: weights-stdp/fc1_weights.syntxt
[LOG] Learn frame samples (frames/frame*)
Notice: stimuli depth is 8U (according to database first stimulus)
[LOG] Test frame samples (frames/test_frame*)
Error for testing: DeepNet::getTargetCell(): wrong cell type for index 0
Continue...
Importing weights from directory 'weights_range_normalized'.
Time elapsed: 1.40786 s
Error: Could not open synaptic file: weights_range_normalized/fc1_weights.syntxt

from n2d2.

vankhoa21991 avatar vankhoa21991 commented on August 24, 2024

Actually I get the points, the weights_range_normalized folder only created by the function test (image). So for testing an SNN trained by back propagation on ANN and run on pure spike (NMNIST), I guess it's not possible. Another question about the mnist-stdp-NMNIST, I can only reach ~12%, do you know about this?

from n2d2.

olivierbichler-cea avatar olivierbichler-cea commented on August 24, 2024

Hi, what you are saying is entirely possible. Actually there is a conflict between the -w parameter and the weight_range_normalized folder which is forced in testing when not using -learn-stdp. This behavior is confusing and must be changed. As a temporary fix, you can juste rename the weight_stdp or weight_validation folder into weight_range_normalized.

from n2d2.

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.