Skip to content

Commit 19e4e7f

Browse files
readme changes
1 parent b354702 commit 19e4e7f

File tree

3 files changed

+28
-19
lines changed

3 files changed

+28
-19
lines changed

README.md

Lines changed: 7 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,8 @@
1-
# ReservoirComputing.jl
1+
<p align="center">
2+
<img width="400px" src="docs/src/assets/logo.png"/>
3+
</p>
4+
5+
<div align="center">
26

37
[![Join the chat at https://julialang.zulipchat.com #sciml-bridged](https://img.shields.io/static/v1?label=Zulip&message=chat&color=9558b2&labelColor=389826)](https://julialang.zulipchat.com/#narrow/stream/279055-sciml-bridged)
48
[![Global Docs](https://img.shields.io/badge/docs-SciML-blue.svg)](https://docs.sciml.ai/ReservoirComputing/stable/)
@@ -11,8 +15,9 @@
1115
[![ColPrac: Contributor's Guide on Collaborative Practices for Community Packages](https://img.shields.io/badge/ColPrac-Contributor%27s%20Guide-blueviolet)](https://github.com/SciML/ColPrac)
1216
[![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle)
1317

14-
![rc_full_logo_large_white_cropped](https://user-images.githubusercontent.com/10376688/144242116-8243f58a-5ac6-4e0e-88d5-3409f00e20b4.png)
18+
</div>
1519

20+
# ReservoirComputing.jl
1621
ReservoirComputing.jl provides an efficient, modular and easy to use implementation of Reservoir Computing models such as Echo State Networks (ESNs). For information on using this package please refer to the [stable documentation](https://docs.sciml.ai/ReservoirComputing/stable/). Use the [in-development documentation](https://docs.sciml.ai/ReservoirComputing/dev/) to take a look at at not yet released features.
1722

1823
## Quick Example

docs/src/esn_tutorials/change_layers.md

Lines changed: 16 additions & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,9 @@ weights = init(rng, dims...)
77
#rng is optional
88
weights = init(dims...)
99
```
10+
1011
Additional keywords can be added when needed:
12+
1113
```julia
1214
weights_init = init(rng; kwargs...)
1315
weights = weights_init(rng, dims...)
@@ -32,26 +34,27 @@ predict_len = 2000
3234
ds = Systems.henon()
3335
traj, t = trajectory(ds, 7000)
3436
data = Matrix(traj)'
35-
data = (data .-0.5) .* 2
37+
data = (data .- 0.5) .* 2
3638
shift = 200
3739
38-
training_input = data[:, shift:shift+train_len-1]
39-
training_target = data[:, shift+1:shift+train_len]
40-
testing_input = data[:,shift+train_len:shift+train_len+predict_len-1]
41-
testing_target = data[:,shift+train_len+1:shift+train_len+predict_len]
40+
training_input = data[:, shift:(shift + train_len - 1)]
41+
training_target = data[:, (shift + 1):(shift + train_len)]
42+
testing_input = data[:, (shift + train_len):(shift + train_len + predict_len - 1)]
43+
testing_target = data[:, (shift + train_len + 1):(shift + train_len + predict_len)]
4244
```
45+
4346
Now it is possible to define the input layers and reservoirs we want to compare and run the comparison in a simple for loop. The accuracy will be tested using the mean squared deviation msd from StatsBase.
4447

4548
```@example minesn
4649
using ReservoirComputing, StatsBase
4750
4851
res_size = 300
49-
input_layer = [minimal_init(; weight = 0.85, sampling_type=:irrational),
50-
minimal_init(; weight = 0.95, sampling_type=:irrational)]
51-
reservoirs = [simple_cycle(; weight=0.7),
52-
cycle_jumps(; cycle_weight=0.7, jump_weight=0.2, jump_size=5)]
52+
input_layer = [minimal_init(; weight = 0.85, sampling_type = :irrational),
53+
minimal_init(; weight = 0.95, sampling_type = :irrational)]
54+
reservoirs = [simple_cycle(; weight = 0.7),
55+
cycle_jumps(; cycle_weight = 0.7, jump_weight = 0.2, jump_size = 5)]
5356
54-
for i=1:length(reservoirs)
57+
for i in 1:length(reservoirs)
5558
esn = ESN(training_input, 2, res_size;
5659
input_layer = input_layer[i],
5760
reservoir = reservoirs[i])
@@ -60,9 +63,10 @@ for i=1:length(reservoirs)
6063
println(msd(testing_target, output))
6164
end
6265
```
66+
6367
As it is possible to see, changing layers in ESN models is straightforward. Be sure to check the API documentation for a full list of reservoir and layers.
6468

6569
## Bibliography
66-
[^rodan2012]: Rodan, Ali, and Peter Tiňo. “Simple deterministically constructed cycle reservoirs with regular jumps.” Neural computation 24.7 (2012): 1822-1852.
6770

68-
[^rodan2010]: Rodan, Ali, and Peter Tiňo. “Minimum complexity echo state network.” IEEE transactions on neural networks 22.1 (2010): 131-144.
71+
[^rodan2012]: Rodan, Ali, and Peter Tiňo. “Simple deterministically constructed cycle reservoirs with regular jumps.” Neural computation 24.7 (2012): 1822-1852.
72+
[^rodan2010]: Rodan, Ali, and Peter Tiňo. “Minimum complexity echo state network.” IEEE transactions on neural networks 22.1 (2010): 131-144.

src/ReservoirComputing.jl

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,8 @@ forecasts by recursively feeding their own outputs back as inputs for
5050
subsequent prediction steps.
5151
5252
# Parameters
53-
- `prediction_len::Int`: The number of future steps to predict.
53+
54+
- `prediction_len::Int`: The number of future steps to predict.
5455
5556
# Description
5657
@@ -63,7 +64,6 @@ At each step, the model takes the current input, generates a prediction,
6364
and then incorporates that prediction into the input for the next step.
6465
This recursive process continues until the specified
6566
number of prediction steps (`prediction_len`) is reached.
66-
6767
"""
6868
struct Generative{T} <: AbstractPrediction
6969
prediction_len::T
@@ -82,8 +82,9 @@ where a model predicts labels based on a provided set
8282
of input features (`prediction_data`).
8383
8484
# Parameters
85-
- `prediction_data`: The input data used for prediction, typically structured as a matrix
86-
where each column represents a sample, and each row represents a feature.
85+
86+
- `prediction_data`: The input data used for prediction, typically structured as a matrix
87+
where each column represents a sample, and each row represents a feature.
8788
8889
# Description
8990
@@ -97,7 +98,6 @@ instead, it operates on fixed input data to produce a single batch of prediction
9798
This method is suitable for tasks like classification,
9899
regression, or other use cases where the input features
99100
and the number of steps are predefined.
100-
101101
"""
102102
function Predictive(prediction_data)
103103
prediction_len = size(prediction_data, 2)

0 commit comments

Comments
 (0)