The KerasSpiking team is pleased to announce the release of KerasSpiking 0.2.0.
KerasSpiking is an add-on for TensorFlow/Keras that provides tools for training and running spiking neural networks directly within the Keras framework. KerasSpiking provides a
SpikingActivation layer that can convert any activation function into a spiking equivalent, as well as tools for filtering spikes, regularizing firing rates, and estimating energy usage on both traditional and neuromorphic hardware. These tools allow for quick prototyping and testing of spiking neural networks from 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
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:
# 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)
See the Classifying Fashion MNIST with spiking activations notebook for a concrete practical example of
SpikingActivation and other KerasSpiking features. Information on accessing the more advanced features of KerasSpiking can be found in the documentation.
This release contains a couple API changes to the filtering layers (
Alpha). These layers now accept
tau_constraint arguments, which can be used to constrain the values of their respective parameters during training. We also renamed the
tau parameter to
tau_initializer, and it can now accept any Keras Initializer (in addition to the previous behaviour of taking a float).
Check out the GitHub release page for a full changelog.
To install KerasSpiking, we recommend using
pip install keras-spiking
More detailed installation instructions can be found here.
You’re already there! If you have an issue upgrading or have any other questions, please post them in this forum.