EchoTorch is a python module based on pyTorch to implement and test various flavours of Echo State Network models. EchoTorch is not intended to be put into production but for research purposes. As it is based on pyTorch, EchoTorch's layers can be integrated into deep architectures. EchoTorch gives two possible ways to train models :
Join our community to create datasets and deep-learning models! Chat with us on Gitter and join the Google Group to collaborate with us.
This repository consists of:
These instructions will get you a copy of the project up and running on your local machine for development and testing purposes. See deployment for notes on how to deploy the project on a live system.
You need to following package to install EchoTorch.
pip install EchoTorch
This project is licensed under the GPLv3 License - see the LICENSE file for details.
If you find EchoTorch useful for an academic publication, then please use the following BibTeX to cite it:
@misc{echotorch,
author = {Schaetti, Nils},
title = {EchoTorch: Reservoir Computing with pyTorch},
year = {2018},
publisher = {GitHub},
journal = {GitHub repository},
howpublished = {\url{https://github.com/nschaetti/EchoTorch}},
}
You can simply create an ESN with the ESN or LiESN objects in the nn module.
esn = etnn.LiESN(
input_dim,
n_hidden,
output_dim,
spectral_radius,
learning_algo='inv',
leaky_rate=leaky_rate
)
Where
You now just have to give the ESN the inputs and the attended outputs.
for data in trainloader:
# Inputs and outputs
inputs, targets = data
# To variable
inputs, targets = Variable(inputs), Variable(targets)
# Give the example to EchoTorch
esn(inputs, targets)
# end for
After giving all examples to EchoTorch, you just have to call the finalize method.
esn.finalize()
The model is now trained and you can call the esn object to get a prediction.
predicted = esn(test_input)