You are here

Sample Echo State Network source codes

Mantas Lukoševičius >

Educational Echo State Network implementations

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). They are generated using Oger toolbox. 

  • 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 R programming environment (tested on version 2.15.1). It's free.

Source code: minimalESN.R.


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