Mantas' ESN source code

Educational Echo State Network implementations in Matlab, Python and R

The code available on this page has been contributed by Dr. Mantas Lukoševičius, now research associate at Kaunas University, when he was doing his PhD in MINDS.

While using powerful off-the-shelf Machine Learning libraries and toolboxes can save a lot of work, they can also impede understanding of the methods hidden inside them and lead to incorrect use.

Echo State Network (ESN) is a powerful supervised recurrent neural network training approach that is also easy to understand and implement. Here you will find some instructional minimalistic self-contained demo scripts in several programming languages that implement, train, and use ESNs – all in one page of code, in plain sight, with no custom subroutines where the “action” is hidden.

This ESN demo solves a classical task of learning to generate/predict a chaotic attractor. The Mackey-Glass (delay=17) time series data for the examples is available here: MackeyGlass_t17.txt, or (needs unpacking).

In plain Matlab

Requires Matlab (tested on version R2008b). Source code: minimalESN.m.

In plain scientific Python

Requires Python (tested on version 2.7.3) with general scientific libraries NumPy, SciPy, and MatPlotLib. They are all free. Source code: (remove “.txt”).

In plain R

Requires the R programming environment (tested on version 2.15.1). It’s free. Source code: minimalESN.R.

Tutorial paper on practical work with ESNs

If you find these implementations useful, please take a look at (and cite) Mantas’ tutorial book chapter on applying Echo State Networks.