This repository contains the code used in the scientific paper Persistent Memory in Single Node Delay-Coupled Reservoir Computing, published on October 26, 2016 in PLOS|One.
The complete code is shared here so that the discussed simulations and plots may be reproduced by anyone interested. Instructions on how to run the simulations may be found below.
It shows the desired vs. the observed signal of the trained reservoir on the simple task to switch between outputting a sine wave upon a first trigger, and reverting to outputting a constant value upon a second trigger.
-
Clone the repository
git clone https://github.com/andrekovac/reservoir-persistent-memory.git -
MATLAB
- Open MATLAB
- Make the
srcfolder inside the cloned folder (i.e.reservoir-persistent-memory/src) the current folder (i.e. navigate to that folder in MATLAB and double click it, so that its contents are directly visible in the 'Current Folder' window on the left. - Run the script
main.m
- Next to MATLAB, you additionally need the following MATLAB add-ons to run the simulations:
- Statistics and Machine Learning Toolbox
- Signal Processing Toolbox
dashline.mwhich can be freely downloaded from MATLAB Central
Please see the chart in the Structure section below to see exactly where dependencies to these two packages occur in the code.
main.mis the starting point. Uncomment the appropriate section to run the simulation with the other tasks.- When using the provided default values, the script will take about 30 seconds to execute (tested on a Macbook Pro late 2013)
- The width of plots depends on the screen-size of your computer screen. Thus, your plots might be scaled by some factor as compared to the figures in the publication.
- Default values are used. Alternatives are usually described in a comment at the particular location in the code.
- Details to this project may be found in the PLOS|ONE paper.
The call-structure of the project. Nested functions signify that the daughter function is called by the mother function. Thus, the mother function depends on the existence of the daughter function in order to execute properly.
This project depends on some functions from the MATLAB Statistics and Machine Learning Toolbox. This is indicated next to the corresponding functions.
βββ main
βββ main_fct_task_with_fdb
βββ fctTask
βββ normpdf // statistics toolbox
βββ fullMasks
βββ randomMasks
βββ subsetMasks
βββ initializeReservoir
βββ createReservoirTheta
βββ createRerservoirO
βββ createReservoirInput
βββ simulateReservoir
βββ trainOnReservoir
βββ designMatrix
βββ ridge // statistics toolbox
βββ glmfit // statistics toolbox
βββ robustfit // statistics toolbox
βββ simulateReservoir
βββ trainOnReservoir
βββ generateResults
βββ designMatrix
βββ xcov // signal processing toolbox
βββ plotResults_fctTask_WITH_Fdb_TASKS
βββ dashline // http://www.mathworks.com/matlabcentral/fileexchange/1892-dashline
... other plot functions
βββ main_fct_task_without_fdb
βββ fctTask
βββ main_linear_nonLinearTask
βββ linear_nonLinearTask_rand
βββ main_rampingTask_with_fdb
βββ rampingTask
βββ main_rampingTask_without_fdb
βββ rampingTask
* : Equal project contributors and creators of the code in this repository.
Thanks go to Johannes Schumacher for an initial implementation of the reservoir simulation.
