Skip to content

Commit 136addf

Browse files
format
1 parent e5eeb7e commit 136addf

File tree

3 files changed

+6
-14
lines changed

3 files changed

+6
-14
lines changed

src/esn/esn.jl

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -50,7 +50,6 @@ julia> train_data = rand(Float32, 10, 100) # 10 features, 100 time steps
5050
5151
julia> esn = ESN(train_data, 10, 300; washout=10)
5252
ESN(10 => 300)
53-
5453
```
5554
"""
5655
function ESN(train_data,
@@ -95,8 +94,9 @@ function (esn::AbstractEchoStateNetwork)(prediction::AbstractPrediction,
9594
kwargs...)
9695
end
9796

98-
Base.show(io::IO, esn::ESN) =
97+
function Base.show(io::IO, esn::ESN)
9998
print(io, "ESN(", size(esn.train_data, 1), " => ", size(esn.reservoir_matrix, 1), ")")
99+
end
100100

101101
#training dispatch on esn
102102
"""
@@ -110,7 +110,6 @@ Trains an Echo State Network (ESN) using the provided target data and a specifie
110110
- `target_data`: Supervised training data for the ESN.
111111
- `training_method`: The method for training the ESN (default: `StandardRidge(0.0)`).
112112
113-
114113
# Example
115114
116115
```jldoctest
@@ -132,7 +131,6 @@ ESN(10 => 300)
132131
133132
julia> output_layer = train(esn, rand(Float32, 3, 90))
134133
OutputLayer successfully trained with output size: 3
135-
136134
```
137135
"""
138136
function train(esn::AbstractEchoStateNetwork,

src/esn/esn_reservoir_drivers.jl

Lines changed: 1 addition & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,6 @@ specified reservoir driver.
2020
and reservoir nodes.
2121
- `bias_vector`: The bias vector to be added at each time step during the reservoir
2222
update.
23-
2423
"""
2524
function create_states(reservoir_driver::AbstractReservoirDriver,
2625
train_data,
@@ -108,8 +107,6 @@ echo state networks (`ESN`).
108107
Defaults to `tanh_fast`.
109108
- `leaky_coefficient`: The leaky coefficient used in the RNN.
110109
Defaults to 1.0.
111-
112-
113110
"""
114111
function RNN(; activation_function=NNlib.fast_act(tanh), leaky_coefficient=1.0)
115112
RNN(activation_function, leaky_coefficient)
@@ -185,7 +182,6 @@ This function creates an MRNN object with the specified activation functions,
185182
leaky coefficient, and scaling factors, which can be used as a reservoir driver
186183
in the ESN.
187184
188-
189185
[^Lun2015]: Lun, Shu-Xian, et al.
190186
"_A novel model of leaky integrator echo state network for
191187
time-series prediction._" Neurocomputing 159 (2015): 58-66.
@@ -234,10 +230,9 @@ end
234230
Returns a Fully Gated Recurrent Unit (FullyGated) initializer
235231
for the Echo State Network (ESN).
236232
237-
Returns the standard gated recurrent unit [^Cho2014] as a driver for the
233+
Returns the standard gated recurrent unit [^Cho2014] as a driver for the
238234
echo state network (`ESN`).
239235
240-
241236
[^Cho2014]: Cho, Kyunghyun, et al.
242237
"_Learning phrase representations using RNN encoder-decoder
243238
for statistical machine translation._"
@@ -281,7 +276,6 @@ This driver is based on the GRU architecture [^Cho2014].
281276
- `variant`: The GRU variant to use.
282277
By default, it uses the "FullyGated" variant.
283278
284-
285279
[^Cho2014]: Cho, Kyunghyun, et al.
286280
"_Learning phrase representations using RNN encoder-decoder for statistical machine translation._"
287281
arXiv preprint arXiv:1406.1078 (2014).

src/predict.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,8 +9,9 @@ struct OutputLayer{T, I, S, L} <: AbstractOutputLayer
99
last_value::L
1010
end
1111

12-
Base.show(io::IO, ol::OutputLayer) =
12+
function Base.show(io::IO, ol::OutputLayer)
1313
print(io, "OutputLayer successfully trained with output size: ", ol.out_size)
14+
end
1415

1516
#prediction types
1617
"""
@@ -58,14 +59,13 @@ of input features (`prediction_data`).
5859
5960
The `Predictive` prediction method uses the provided input data
6061
(`prediction_data`) to produce corresponding labels or outputs based
61-
on the learned relationships in the model.
62+
on the learned relationships in the model.
6263
"""
6364
function Predictive(prediction_data)
6465
prediction_len = size(prediction_data, 2)
6566
Predictive(prediction_data, prediction_len)
6667
end
6768

68-
6969
function obtain_prediction(rc::AbstractReservoirComputer,
7070
prediction::Generative,
7171
x,

0 commit comments

Comments
 (0)