sylvchev / simple_esn

simple Echo State Networks integrated with scikit-learn

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Simple Echo State Network

Coverage Status Travis CI Code Climate

Simple ESN

simple_esn implement a Python class of simple Echo State Network models within the Scikit-learn framework. It is intended to be a fast-and-easy transformation of an input signal in a reservoir of neurons. The classification or regression could be done with any scikit-learn classifier/regressor.

The SimpleESN object could be part of a Pipeline and its parameter space could be explored with a GridSearchCV, for example.

The code is inspired by the "minimalistic ESN example" proposed by Mantas Lukoševičius. It is licenced under GPLv3.

Useful links

Dependencies

The only dependencies are scikit-learn, numpy and scipy.

Installation

Install with python setup.py install or python setup.py develop

Examples

Using the SimpleESN class is easy as:

from simple_esn.simple_esn import SimpleESN
import numpy as np
n_samples, n_features = 10, 5
np.random.seed(0)
X = np.random.randn(n_samples, n_features)
esn = SimpleESN(n_readout = 2)
echoes = esn.fit_transform(X)

It could also be part of a Pipeline:

from simple_esn.simple_esn import SimpleESN
# Pick your classifier
pipeline = Pipeline([('esn', SimpleESN(n_readout=1000)),
                     ('svr', svm.SVR())])
parameters = {
    'esn__weight_scaling': [0.5, 1.0],
    'svr__C': [1, 10]
}
grid_search = GridSearchCV(pipeline, parameters)
grid_search.fit(X_train, y_train)

About

simple Echo State Networks integrated with scikit-learn

License:GNU General Public License v3.0


Languages

Language:Python 100.0%