Skip to content

Commit 2dc3a93

Browse files
fixing docs, format
1 parent d9828c9 commit 2dc3a93

36 files changed

+303
-3232
lines changed

.JuliaFormatter.toml

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,9 @@
11
style = "sciml"
22
format_markdown = true
3-
format_docstrings = true
3+
whitespace_in_kwargs = false
4+
margin = 92
5+
indent = 4
6+
format_docstrings = true
7+
separate_kwargs_with_semicolon = true
8+
always_for_in = true
9+
annotate_untyped_fields_with_any = false

.gitignore

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,6 +2,6 @@
22
*.jl.cov
33
*.jl.mem
44
.DS_Store
5-
/Manifest.toml
5+
Manifest.toml
66
/dev/
77
docs/build

README.md

Lines changed: 10 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -11,11 +11,11 @@
1111
[![Build status](https://badge.buildkite.com/db8f91b89a10ad79bbd1d9fdb1340e6f6602a1c0ed9496d4d0.svg)](https://buildkite.com/julialang/reservoircomputing-dot-jl)
1212
[![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)
1313
[![SciML Code Style](https://img.shields.io/static/v1?label=code%20style&message=SciML&color=9558b2&labelColor=389826)](https://github.com/SciML/SciMLStyle)
14-
1514
</div>
1615

1716
# ReservoirComputing.jl
1817
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.
18+
1919
## Quick Example
2020

2121
To illustrate the workflow of this library we will showcase how it is possible to train an ESN to learn the dynamics of the Lorenz system. As a first step we will need to gather the data. For the `Generative` prediction we need the target data to be one step ahead of the training data:
@@ -36,7 +36,7 @@ function lorenz(du, u, p, t)
3636
end
3737
#solve and take data
3838
prob = ODEProblem(lorenz, u0, tspan, p)
39-
data = Array(solve(prob, ABM54(), dt = 0.02))
39+
data = Array(solve(prob, ABM54(); dt=0.02))
4040

4141
shift = 300
4242
train_len = 5000
@@ -55,9 +55,9 @@ Now that we have the data we can initialize the ESN with the chosen parameters.
5555
input_size = 3
5656
res_size = 300
5757
esn = ESN(input_data, input_size, res_size;
58-
reservoir = rand_sparse(; radius = 1.2, sparsity = 6 / res_size),
59-
input_layer = weighted_init,
60-
nla_type = NLAT2())
58+
reservoir=rand_sparse(; radius=1.2, sparsity=6 / res_size),
59+
input_layer=weighted_init,
60+
nla_type=NLAT2())
6161
```
6262

6363
The echo state network can now be trained and tested. If not specified, the training will always be ordinary least squares regression. The full range of training methods is detailed in the documentation.
@@ -71,8 +71,8 @@ The data is returned as a matrix, `output` in the code above, that contains the
7171

7272
```julia
7373
using Plots
74-
plot(transpose(output), layout = (3, 1), label = "predicted")
75-
plot!(transpose(test), layout = (3, 1), label = "actual")
74+
plot(transpose(output); layout=(3, 1), label="predicted")
75+
plot!(transpose(test); layout=(3, 1), label="actual")
7676
```
7777

7878
![lorenz_basic](https://user-images.githubusercontent.com/10376688/166227371-8bffa318-5c49-401f-9c64-9c71980cb3f7.png)
@@ -82,9 +82,9 @@ One can also visualize the phase space of the attractor and the comparison with
8282
```julia
8383
plot(transpose(output)[:, 1],
8484
transpose(output)[:, 2],
85-
transpose(output)[:, 3],
86-
label = "predicted")
87-
plot!(transpose(test)[:, 1], transpose(test)[:, 2], transpose(test)[:, 3], label = "actual")
85+
transpose(output)[:, 3];
86+
label="predicted")
87+
plot!(transpose(test)[:, 1], transpose(test)[:, 2], transpose(test)[:, 3]; label="actual")
8888
```
8989

9090
![lorenz_attractor](https://user-images.githubusercontent.com/10376688/81470281-5a34b580-91ea-11ea-9eea-d2b266da19f4.png)

0 commit comments

Comments
 (0)