Comments (8)
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.
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.
I found the answer, have to use -learn-stdp instead.
from n2d2.
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.
Hello,
I think you have to specify the folder "weights-stdp" for testing :
./n2d2 ../../../models/mnist-stdp.ini -w weights-stdp -test
from n2d2.
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.
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.
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)
- Do not insert Target in ONNX HOT 1
- Bug ONNX HOT 1
- N2D2 Cross Compilation HOT 2
- ONNX not available when using dockerized N2D2 HOT 2
- Feature maps HOT 1
- multiple common.config in .ini file HOT 1
- Import Onnx give a segfault HOT 20
- VGG on CIFAR HOT 2
- Compilation n2d2 : 'runtime_error' is not a member of 'std' HOT 2
- Issue while running MNIST HOT 4
- Reshape Quantization not supported? HOT 1
- Invalid registrar key "Transcode" HOT 2
- Could not find NVML during CMake on a Jetson Orin (iGPU) HOT 2
- Make fails during linking HOT 2
- Make fails to compile HOT 1
- Install Gnuplot but still giving this error "Could NOT find Gnuplot (missing: GNUPLOT_EXECUTABLE)" HOT 4
- Multiples issues on Windows HOT 1
- Adapt scripts to Python 3
- Loading ONNX models results in invalid path on Windows HOT 1
- Log labels mapping only 2 classes HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
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.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from n2d2.