KerasSpiking 0.2.0 released

The KerasSpiking team is pleased to announce the release of KerasSpiking 0.2.0.

What is KerasSpiking?

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.

How do I use it?

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.

What’s new?

This release (0.2.0) adds a number of new features:

  • The new Alpha filtering layer is similar to the Lowpass filtering layer, but provides better filtering of spike noise.
  • There are new regularizers that allow constraining values (usually neuron activites) to within a particular range (RangedRegularizer), or computing a percentile across a number of examples and optimizing that statistic (Percentile).
  • The new ModelEnergy class provides a model summary with information about the number of operations per layer, and estimates of how much energy the model would use if implemented on different types of traditional or neuromorphic (spike-based) hardware. See the new Estimating Model Energy notebook for an example.

And as always, we fixed some bugs!

Check out the GitHub release page for a full changelog.

How do I get it?

To install KerasSpiking, we recommend using pip:

pip install keras-spiking

More detailed installation instructions can be found here.

Where can I learn more?

Where can I get help?

You’re already there! If you have an issue upgrading or have any other questions, please post them in this forum.

1 Like