Skip to content

TRSasasusu/SpikingMoYF

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

30 Commits
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Spiking MoYF

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

Examples

$ 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. 0

1

2

Requirements

  • Python 3
  • NumPy
  • scikit-learn

License

MIT License

About

Spiking Neural Network

Resources

License

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages