Ecosyste.ms: Awesome
An open API service indexing awesome lists of open source software.
https://github.com/nengo/keras-spiking
Spiking neuron integration for Keras
https://github.com/nengo/keras-spiking
deep-learning keras python spiking-neural-networks tensorflow
Last synced: about 1 month ago
JSON representation
Spiking neuron integration for Keras
- Host: GitHub
- URL: https://github.com/nengo/keras-spiking
- Owner: nengo
- License: other
- Created: 2020-08-07T13:30:55.000Z (over 4 years ago)
- Default Branch: main
- Last Pushed: 2024-02-28T20:12:45.000Z (10 months ago)
- Last Synced: 2024-11-08T09:09:52.157Z (about 2 months ago)
- Topics: deep-learning, keras, python, spiking-neural-networks, tensorflow
- Language: Python
- Homepage: https://www.nengo.ai/keras-spiking/
- Size: 13.1 MB
- Stars: 31
- Watchers: 7
- Forks: 2
- Open Issues: 9
-
Metadata Files:
- Readme: README.rst
- Changelog: CHANGES.rst
- Contributing: CONTRIBUTING.rst
- License: LICENSE.rst
Awesome Lists containing this project
README
.. image:: https://img.shields.io/pypi/v/keras-spiking.svg
:target: https://pypi.org/project/keras-spiking
:alt: Latest PyPI version.. image:: https://img.shields.io/pypi/pyversions/keras-spiking.svg
:target: https://pypi.org/project/keras-spiking
:alt: Python versions************
KerasSpiking
************KerasSpiking provides tools for training and running spiking neural networks
directly within the Keras framework. The main feature is
``keras_spiking.SpikingActivation``, which can be used to transform
any activation function into a spiking equivalent. For example, we can translate a
non-spiking model, such as.. code-block:: python
inp = tf.keras.Input((5,))
dense = tf.keras.layers.Dense(10)(inp)
act = tf.keras.layers.Activation("relu")(dense)
model = tf.keras.Model(inp, act)into the spiking equivalent:
.. code-block:: python
# add time dimension to inputs
inp = tf.keras.Input((None, 5))
dense = tf.keras.layers.Dense(10)(inp)
# replace Activation with SpikingActivation
act = keras_spiking.SpikingActivation("relu")(dense)
model = tf.keras.Model(inp, act)Models with SpikingActivation layers can be optimized and evaluated in the same way as
any other Keras model. They will automatically take advantage of KerasSpiking's
"spiking aware training": using the spiking activations on the forward pass and the
non-spiking (differentiable) activation function on the backwards pass.KerasSpiking also includes various tools to assist in the training of spiking models,
such as additional `regularizers
`_
and `filtering layers
`_.If you are interested in building and optimizing spiking neuron models, you may also
be interested in `NengoDL `_. See
`this page `_ for a
comparison of the different use cases supported by these two packages.**Documentation**
Check out the `documentation `_ for
- `Installation instructions
`_
- `More detailed example introducing the features of KerasSpiking
`_
- `API reference `_