Skip to content

HyperCogWizard/reservoircogs

ย 
ย 

Folders and files

NameName
Last commit message
Last commit date

Latest commit

ย 

History

829 Commits
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 
ย 

Repository files navigation

ReservoirCogs: Advanced Reservoir Computing with OpenCog AtomSpace Integration

Flexible library for Reservoir Computing architectures like Echo State Networks (ESN) with deep symbolic AI integration through OpenCog AtomSpace.

PyPI version HAL PyPI - Python Version OpenCog Integration
Downloads Documentation Status Testing codecov


Google Colab iconTutorials: Open in Colab

Open book iconDocumentation: Getting Started | User Guide | AtomSpace Integration

C++ iconC++ API: High-performance reservoir computing with OpenCog AtomSpace integration

๐Ÿ“‹ GitHub Project iconProject Board: Development Roadmap | GitHub Project


Tip

๐ŸŽ‰ Exciting News! We just launched a new beta tool based on a Large Language Model! ๐Ÿš€ You can chat with ReservoirChat and ask anything about Reservoir Computing and ReservoirPy! ๐Ÿค–๐Ÿ’ก Donโ€™t miss out, itโ€™s available for a limited time! โณ

https://chat.reservoirpy.inria.fr

๐ŸŒŸ NEW: ReservoirChat Playground - Mindbendingly Amazing Interactive Experience!



๐Ÿš€ NEW: OpenCog AtomSpace Integration

ReservoirCogs now includes deep integration with OpenCog AtomSpace for symbolic AI capabilities:

  • Symbolic Representation: Store reservoir states and dynamics as AtomSpace knowledge
  • Temporal Logic: Reason about sequences and temporal patterns
  • Knowledge Extraction: Extract learned patterns as symbolic concepts
  • High Performance: C++ implementation for production systems
  • Hybrid AI: Combine neural reservoir computing with symbolic reasoning

Feature overview:

Moreover, graphical tools are included to easily explore hyperparameters with the help of the hyperopt library.

Quick try โšก

Python Installation

pip install reservoirpy

C++ Installation with OpenCog

# Install OpenCog dependencies
sudo apt-get install opencog-dev

# Clone and build ReservoirCogs
git clone https://github.com/HyperCogWizard/reservoircogs.git
cd reservoircogs
mkdir build && cd build
cmake ..
make -j4
sudo make install

Basic Python Usage

import reservoirpy as rpy
from reservoirpy.nodes import Reservoir, Ridge

# Create a simple ESN
reservoir = Reservoir(100, lr=0.3, sr=0.9)
readout = Ridge(ridge=1e-6)

# Connect and train
model = reservoir >> readout
model.fit(X_train, y_train)
predictions = model.run(X_test)

C++ AtomSpace Usage

#include <opencog/reservoir/nodes/ReservoirNode.h>

// Create AtomSpace and reservoir
auto atomspace = createAtomSpace();
auto esn = std::make_shared<EchoStateNetwork>(atomspace, 100, 3, 1);

// Configure and train
esn->set_leaking_rate(0.3);
algorithms::ReservoirTrainer trainer(atomspace);
trainer.train_esn_ridge_regression(esn, inputs, targets);
auto predictions = esn->predict(test_input);

An example on chaotic timeseries prediction (Mackey-Glass)

For a general introduction to reservoir computing and ReservoirPy features, take a look at the tutorials

from reservoirpy.datasets import mackey_glass, to_forecasting
from reservoirpy.nodes import Reservoir, Ridge
from reservoirpy.observables import rmse, rsquare

### Step 1: Load the dataset

X = mackey_glass(n_timesteps=2000)  # (2000, 1)-shaped array
# create y by shifting X, and train/test split
x_train, x_test, y_train, y_test = to_forecasting(X, test_size=0.2)

### Step 2: Create an Echo State Network

# 100 neurons reservoir, spectral radius = 1.25, leak rate = 0.3
reservoir = Reservoir(units=100, sr=1.25, lr=0.3)
# feed-forward layer of neurons, trained with L2-regularization
readout = Ridge(ridge=1e-5)
# connect the two nodes
esn = reservoir >> readout

### Step 3: Fit, run and evaluate the ESN

esn.fit(x_train, y_train, warmup=100)
predictions = esn.run(x_test)

print(f"RMSE: {rmse(y_test, predictions)}; R^2 score: {rsquare(y_test, predictions)}")
# RMSE: 0.0020282; R^2 score: 0.99992

More examples and tutorials ๐ŸŽ“

Tutorials

Examples

For advanced users, we also showcase partial reproduction of papers on reservoir computing to demonstrate some features of the library.

๐Ÿ—๏ธ Project Organization & Development Roadmap

ReservoirCogs development is organized through a comprehensive GitHub Project that orchestrates both short-term and long-term implementation of our feature portfolio.

๐Ÿ”ง Current Technical Features

Active development focusing on production-ready capabilities:

  • ๐Ÿ•ธ๏ธ GraphRAG Integration: Knowledge graph-based retrieval-augmented generation
  • โšก Codestral AI Engine: Specialized language model for technical documentation
  • ๐Ÿง  AtomSpace Intelligence: OpenCog symbolic AI reasoning capabilities
  • ๐Ÿ”ฎ Hybrid AI Architecture: Neural-symbolic fusion implementation

๐Ÿš€ Future Development Roadmap

Research-driven features for long-term innovation:

  • ๐Ÿงฌ P-Systems Membrane Computing with P-lingua integration
  • ๐ŸŒณ B-Series Rooted Tree Gradient Descent with Runge-Kutta methods โœ… Research implementation available
  • ๐Ÿ’Ž J-Surface Julia Differential Equations with DifferentialEquations.jl
  • ๐Ÿ’ Differential Emotion Theory Framework for affective computing โœ… Research implementation available

๐Ÿ“‹ Project Management

Our project uses advanced GitHub Project features including custom fields, automated workflows, and multiple views (Board, Table, Timeline) to ensure efficient coordination of complex, interdisciplinary development spanning traditional software engineering and cutting-edge AI research.

Papers and projects using ReservoirPy

If you want your paper to appear here, please contact us (see contact link below).

  • ( HAL | PDF | Code ) Leger et al. (2024) Evolving Reservoirs for Meta Reinforcement Learning. EvoAPPS 2024
  • ( arXiv | PDF ) Chaix-Eichel et al. (2022) From implicit learning to explicit representations. arXiv preprint arXiv:2204.02484.
  • ( HTML | HAL | PDF ) Trouvain & Hinaut (2021) Canary Song Decoder: Transduction and Implicit Segmentation with ESNs and LTSMs. ICANN 2021
  • ( HTML ) Pagliarini et al. (2021) Canary Vocal Sensorimotor Model with RNN Decoder and Low-dimensional GAN Generator. ICDL 2021.
  • ( HAL | PDF ) Pagliarini et al. (2021) What does the Canary Say? Low-Dimensional GAN Applied to Birdsong. HAL preprint.
  • ( HTML | HAL | PDF ) Hinaut & Trouvain (2021) Which Hype for My New Task? Hints and Random Search for Echo State Networks Hyperparameters. ICANN 2021

Awesome Reservoir Computing

We also provide a curated list of tutorials, papers, projects and tools for Reservoir Computing (not necessarily related to ReservoirPy) here!:

https://github.com/reservoirpy/awesome-reservoir-computing

Contact

If you have a question regarding the library, please open an issue.

If you have more general question or feedback you can contact us by email to xavier dot hinaut the-famous-home-symbol inria dot fr.

Citing ReservoirPy

Trouvain, N., Pedrelli, L., Dinh, T. T., Hinaut, X. (2020) ReservoirPy: an efficient and user-friendly library to design echo state networks. In International Conference on Artificial Neural Networks (pp. 494-505). Springer, Cham. ( HTML | HAL | PDF )

If you're using ReservoirPy in your work, please cite our package using the following bibtex entry:

@incollection{Trouvain2020,
  doi = {10.1007/978-3-030-61616-8_40},
  url = {https://doi.org/10.1007/978-3-030-61616-8_40},
  year = {2020},
  publisher = {Springer International Publishing},
  pages = {494--505},
  author = {Nathan Trouvain and Luca Pedrelli and Thanh Trung Dinh and Xavier Hinaut},
  title = {{ReservoirPy}: An Efficient and User-Friendly Library to Design Echo State Networks},
  booktitle = {Artificial Neural Networks and Machine Learning {\textendash} {ICANN} 2020}
}

Acknowledgement


This package is developed and supported by Inria at Bordeaux, France in Mnemosyne group. Inria is a French Research Institute in Digital Sciences (Computer Science, Mathematics, Robotics, ...).

About

A simple and flexible code for Reservoir Computing architectures like Echo State Networks

Resources

License

Contributing

Stars

Watchers

Forks

Packages

 
 
 

Contributors

Languages

  • Python 88.7%
  • C++ 4.6%
  • JavaScript 1.9%
  • HTML 1.6%
  • CSS 1.3%
  • Scheme 1.0%
  • Other 0.9%