No project description provided
Project description
TorchRC
An organized collection of Reservoir Computing models and techniques that is well-integrated within the PyTorch API.
WARNING: Work in progress!
What's inside
Models
At the moment, the library contains an implementation of:
- (Leaky/Deep/Bidirectional) Echo State Network (
torch_rc.nn.LeakyESN
) - (Leaky/Deep/Bidirectional) Echo State Network with Ring or Multiring Reservoir (
torch_rc.nn.MultiringESN
)
More models are coming.
Optimizers
TorchRC allows to train the reservoir models either in closed form or with the standard PyTorch optimizers. Exact incremental closed form techniques are supported in order to support those scenarios in which it is not feasible to hold all the network states in memory. Training on the GPU is also supported.
Currently supported optimizers:
- Ridge Classification (
torch_rc.optim.RidgeClassification
): for training a readout in closed-form for classification problems. - Ridge Regression (
torch_rc.optim.RidgeRegression
): for training a readout in closed-form for regression problems. - Ridge Incremental Classification (
torch_rc.optim.RidgeIncrementalClassification
): for training a readout in closed-form for classification problems, passing data in multiple separate calls (e.g., for when your collection of states does not fit in memory). - Ridge Incremental Regression (
torch_rc.optim.RidgeIncrementalRegression
): for training a readout in closed-form for regression problems, passing data in multiple separate calls (e.g., for when your collection of states does not fit in memory).
Installation
pip3 install torch-rc
How to use
... wrt to other libs, keeping the readout separated from the reservoir allows high flexibility ...
Step 1: Imports
import torch
import torch_rc.nn
import torch_rc.optim
Step 2: Define your network
esn = torch_rc.nn.LeakyESN(1, reservoir_size, scale_rec=0.99)
readout = torch_rc.nn.Linear(reservoir_size, 1)
Step 3: Train the network
You can find complete example scripts in the examples/ folder.
Project details
Download files
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
Source Distribution
Built Distribution
File details
Details for the file torch_rc-0.4.0.tar.gz
.
File metadata
- Download URL: torch_rc-0.4.0.tar.gz
- Upload date:
- Size: 2.5 kB
- Tags: Source
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 3344e34fe0189d14fb0c66addf6c4a12c25cf3070436cc0a96256b3528bdaf71 |
|
MD5 | 033edb593846c3c5ce3c5e942b7904fd |
|
BLAKE2b-256 | 819e777d438033551bdd4c8931695eee6e7cc0a4fa70c2d16b1711511c41c55c |
File details
Details for the file torch_rc-0.4.0-py3-none-any.whl
.
File metadata
- Download URL: torch_rc-0.4.0-py3-none-any.whl
- Upload date:
- Size: 3.0 kB
- Tags: Python 3
- Uploaded using Trusted Publishing? No
- Uploaded via: twine/3.4.1 importlib_metadata/3.7.3 pkginfo/1.7.0 requests/2.25.1 requests-toolbelt/0.9.1 tqdm/4.56.0 CPython/3.8.5
File hashes
Algorithm | Hash digest | |
---|---|---|
SHA256 | 2f3858a54cc4810b568379f6a960c6caa0ac73adb6b4945318ae029235d2a570 |
|
MD5 | 407aba30bc04899ba0a409a57a684e94 |
|
BLAKE2b-256 | 093ec1c2780f6a2136bd52653e27554a41fca42dec59f971d4a4aa19296694f5 |