Skip to content

Commit 8341aca

Browse files
better docstrings on NLT3
1 parent 4418a90 commit 8341aca

File tree

2 files changed

+26
-15
lines changed

2 files changed

+26
-15
lines changed

docs/make.jl

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,13 +6,17 @@ cp("./docs/Project.toml", "./docs/src/assets/Project.toml"; force=true)
66
ENV["PLOTS_TEST"] = "true"
77
ENV["GKSwstype"] = "100"
88
include("pages.jl")
9+
mathengine = Documenter.MathJax()
910

1011
makedocs(; modules=[ReservoirComputing],
1112
sitename="ReservoirComputing.jl",
1213
clean=true, doctest=false, linkcheck=true,
13-
format=Documenter.HTML(; assets=["assets/favicon.ico"],
14+
format=Documenter.HTML(;
15+
mathengine,
16+
assets=["assets/favicon.ico"],
1417
canonical="https://docs.sciml.ai/ReservoirComputing/stable/"),
15-
pages=pages)
18+
pages=pages
19+
)
1620

1721
deploydocs(; repo="github.com/SciML/ReservoirComputing.jl.git",
1822
push_preview=true)

src/states.jl

Lines changed: 20 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -177,31 +177,38 @@ function nla(::NLAT2, x_old)
177177
return x_new
178178
end
179179

180-
"""
180+
@doc raw"""
181181
NLAT3()
182182
183-
The `NLAT3` struct implements the T₃ transformation algorithm as detailed in [^Chattopadhyay].
184-
This algorithm modifies the reservoir's states by multiplying each odd-indexed row
185-
(beginning from the second row) with the product of the immediately preceding and the
186-
immediately following rows. T₃'s unique approach to data transformation makes it particularly
187-
useful for enhancing complex data patterns, thereby improving the modeling and analysis
188-
capabilities within reservoir computing, especially for chaotic and dynamic systems.
183+
The `NLAT3` struct implements the T₃ transformation algorithm as detailed
184+
in [^Chattopadhyay]. This algorithm modifies the reservoir's states by
185+
multiplying each odd-indexed row (beginning from the second row) with the
186+
product of the immediately preceding and the immediately following rows.
189187
190-
Reference:
188+
```math
189+
\tilde{r}_{i,j} =
190+
\begin{cases}
191+
r_{i,j-1} \times r_{i,j+1}, & \text{if } j > 1 \text{ is odd}; \\
192+
r_{i,j}, & \text{if } j = 1 \text{ or even.}
193+
\end{cases}
194+
```
195+
196+
# Reference:
191197
192198
[^Chattopadhyay]: Chattopadhyay, Ashesh, et al.
193-
"Data-driven prediction of a multi-scale Lorenz 96 chaotic system using a hierarchy of deep learning methods:
194-
Reservoir computing, ANN, and RNN-LSTM." (2019).
199+
"Data-driven predictions of a multiscale Lorenz 96 chaotic system using
200+
machine-learning methods: reservoir computing, artificial neural network,
201+
and long short-term memory network." (2019).
195202
"""
196203
struct NLAT3 <: NonLinearAlgorithm end
197204

198205
function nla(::NLAT3, x_old)
199206
x_new = copy(x_old)
200207
for i in 2:(size(x_new, 1) - 1)
201-
if mod(i, 2) != 0
202-
x_new[i, :] = copy(x_old[i - 1, :] .* x_old[i + 1, :])
208+
if isodd(i)
209+
x_new[i, :] .= x_old[i - 1, :] .* x_old[i + 1, :] # Element-wise update
203210
end
204211
end
205-
212+
206213
return x_new
207214
end

0 commit comments

Comments
 (0)