This is a Spiking Neural Network library based on a below paper. However, this project does NOT completely reflect the paper (detail: Issue: #2).
Training Deep Spiking Neural Networks Using Backpropagation
$ python examples/digits.py
MNIST Loading...OK
...
In 5938
answer:
[[ 1. 1. 1. 1. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 0. 1. 1. 1. 1. 1. 0. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 1. 1. 1. 1.]]
infer:
[[ 1. 1. 1. 1. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 0. 1. 1. 1. 1. 1. 0. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 1. 1. 1. 1.]]
Complete!
Saving...OK
This model is saved in ./models/
.
If you want to use already trained this model, use below.
$ python examples/digits.py --load sample_models/0-2.npz --no-save
MNIST Loading...OK
Loading...OK
No spike... in [False False False False False False False False False False False False
False False False]
In 0
answer:
[[ 1. 1. 1. 1. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 0. 1. 1. 1. 1. 1. 0. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 1. 1. 1. 1.]]
infer:
[[ 1. 1. 1. 1. 1. 0. 0. 0. 0. 0. 0. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 0. 1. 1. 1. 1. 1. 0. 0. 0. 0. 0.]
[ 0. 0. 0. 0. 0. 0. 0. 0. 0. 0. 1. 1. 1. 1. 1.]]
Complete!
You can also visualize these spikes. Use below.
$ python examples/digits.py --load sample_models/0-2.npz --no-save --draw
This visualizes this network distinguishes among 0, 1 and 2.
- Python 3
- NumPy
- scikit-learn
MIT License