Ecosyste.ms: Awesome

An open API service indexing awesome lists of open source software.

Awesome Lists | Featured Topics | Projects

https://github.com/nengo/nengo-gyrus

Recursively generate large-scale Nengo models using NumPy semantics.
https://github.com/nengo/nengo-gyrus

functional-programming nengo neural-networks numpy python

Last synced: about 1 month ago
JSON representation

Recursively generate large-scale Nengo models using NumPy semantics.

Awesome Lists containing this project

README

        

.. image:: https://i.imgur.com/xef9dhv.png
:width: 100%
:target: https://github.com/nengo-labs/nengo-gyrus
:alt: Recursively generate large-scale Nengo models using NumPy semantics.

Recursively generate large-scale `Nengo `_ models using
`NumPy `_ semantics.

Quick Start
===========

.. code-block:: bash

pip install git+https://github.com/nengo-labs/nengo-gyrus

An example of computing the square of a two-dimensional vector with Gyrus:

.. code-block:: python

import gyrus
import matplotlib.pyplot as plt
import numpy as np

u = gyrus.stimuli([np.cos, np.sin])
x = (u ** 2).filter(0.01)
y = np.asarray(x.run(np.pi)) # shape: (fold, time, size_out)

plt.figure()
plt.plot(y.squeeze(axis=-1).T)
plt.xlabel("Time-step")
plt.show()

.. image:: https://i.imgur.com/KyDKeyc.png
:width: 100%
:target: https://github.com/nengo-labs/nengo-gyrus
:alt: Computing the square of a two-dimensional vector with Gyrus.

This code is automagically converted to `Nengo `_ and implemented
via two spiking LIF ensembles and a lowpass synapse.

Gyrus supports many common NumPy 'ufuncs', array functions, and numeric Python
operators. Thus, code can be written in a functional style using N-D arrays and then
realized as a Nengo neural network. This enables algorithms to be written in NumPy and
then compiled onto `Nengo's supported backends `_
(e.g., GPUs, microcontrollers, neuromorphic hardware, and other neural network
accelerators).

Documentation
=============

Check out and render the Jupyter notebooks located in
`docs/examples `_.

The `gyrus_overview
`_
notebook is currently the best starting point to learn the Gyrus API and see a variety
of examples.

Support
=======

Tested against ``nengo>=3.0.0`` and requires ``numpy>=1.17``.

This project is currently pre-alpha. Pull requests are welcome, as are breaking (i.e.,
reverse-incompatible) changes.

If something doesn't work quite as you thought it should, or if you have ideas for
improvements, please feel free to open up a `GitHub issue
`_ or post on the `Nengo Forum
`_.