Skip to content

Commit 772ab72

Browse files
fix: some additional small fixes
1 parent d9f98cb commit 772ab72

File tree

8 files changed

+25
-25
lines changed

8 files changed

+25
-25
lines changed

src/extensions/reca.jl

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -128,7 +128,7 @@ and [Yilmaz2014](@cite).
128128
129129
"""
130130
@concrete struct RECACell <: AbstractReservoirRecurrentCell
131-
automaton::Any
131+
automaton
132132
enc <: RandomMaps
133133
end
134134

src/inits/esn_inits.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -306,17 +306,17 @@ function informed_init(rng::AbstractRNG, ::Type{T}, dims::Integer...;
306306
for jdx in axes(input_matrix, 1)])
307307
random_row_idx = idxs[DeviceAgnostic.rand(rng, T, 1:end)]
308308
random_clm_idx = range(1, state_size; step = 1)[DeviceAgnostic.rand(
309-
rng, T, 1:end)]
309+
rng, T, 1:length(idxs))]
310310
input_matrix[random_row_idx, random_clm_idx] = (DeviceAgnostic.rand(rng, T) -
311311
T(0.5)) .* (T(2) * T(scaling))
312312
end
313313

314314
for idx in 1:num_for_model
315315
idxs = findall(Bool[zero_connections .== input_matrix[jdx, :]
316316
for jdx in axes(input_matrix, 1)])
317-
random_row_idx = idxs[DeviceAgnostic.rand(rng, T, 1:end)]
317+
random_row_idx = idxs[DeviceAgnostic.rand(rng, T, 1:length(idxs))]
318318
random_clm_idx = range(state_size + 1, in_size; step = 1)[DeviceAgnostic.rand(
319-
rng, T, 1:end)]
319+
rng, T, 1:length(idxs))]
320320
input_matrix[random_row_idx, random_clm_idx] = (DeviceAgnostic.rand(rng, T) -
321321
T(0.5)) .* (T(2) * T(scaling))
322322
end

src/layers/basic.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,11 +51,11 @@ before this layer (logically inserting a [`Collect`](@ref) right before it).
5151
which is usually unintended.
5252
"""
5353
@concrete struct LinearReadout <: AbstractReservoirTrainableLayer
54-
activation::Any
54+
activation
5555
in_dims <: IntegerType
5656
out_dims <: IntegerType
57-
init_weight::Any
58-
init_bias::Any
57+
init_weight
58+
init_bias
5959
use_bias <: StaticBool
6060
include_collect <: StaticBool
6161
end

src/layers/esn_cell.jl

Lines changed: 6 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -66,15 +66,15 @@ Created by `initialstates(rng, esn)`:
6666
- `rng`: a replicated RNG used to sample initial hidden states when needed.
6767
"""
6868
@concrete struct ESNCell <: AbstractEchoStateNetworkCell
69-
activation::Any
69+
activation
7070
in_dims <: IntegerType
7171
out_dims <: IntegerType
72-
init_bias::Any
73-
init_reservoir::Any
74-
init_input::Any
72+
init_bias
73+
init_reservoir
74+
init_input
7575
#init_feedback::F
76-
init_state::Any
77-
leak_coefficient::Any
76+
init_state
77+
leak_coefficient
7878
use_bias <: StaticBool
7979
end
8080

src/layers/lux_layers.jl

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -16,7 +16,7 @@ next step.
1616
1717
## Arguments
1818
19-
- `cell`: Any `AbstractReservoirRecurrentCell` (e.g. [`ESNCell`](@ref)).
19+
- `cell`: `AbstractReservoirRecurrentCell` (e.g. [`ESNCell`](@ref)).
2020
2121
## States
2222
@@ -118,7 +118,7 @@ updated states for every layer.
118118
"""
119119
@concrete struct ReservoirChain <: AbstractLuxWrapperLayer{:layers}
120120
layers <: NamedTuple
121-
name::Any
121+
name
122122
end
123123

124124
function ReservoirChain(xs...; name = nothing)

src/models/esn_deep.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -115,9 +115,9 @@ Composition:
115115
116116
"""
117117
@concrete struct DeepESN <: AbstractEchoStateNetwork{(:cells, :states_modifiers, :readout)}
118-
cells::Any
119-
states_modifiers::Any
120-
readout::Any
118+
cells
119+
states_modifiers
120+
readout
121121
end
122122

123123
function DeepESN(in_dims::IntegerType,

src/models/esn_hybrid.jl

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -79,10 +79,10 @@ Created by `initialstates(rng, hesn)`:
7979
"""
8080
@concrete struct HybridESN <: AbstractEchoStateNetwork{(
8181
:cell, :states_modifiers, :readout, :knowledge_model)}
82-
cell::Any
83-
knowledge_model::Any
84-
states_modifiers::Any
85-
readout::Any
82+
cell
83+
knowledge_model
84+
states_modifiers
85+
readout
8686
end
8787

8888
function HybridESN(km,

src/reservoircomputer.jl

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -31,9 +31,9 @@ features, and install trained readout weights.
3131
"""
3232
@concrete struct ReservoirComputer <:
3333
AbstractReservoirComputer{(:reservoir, :states_modifiers, :readout)}
34-
reservoir::Any
35-
states_modifiers::Any
36-
readout::Any
34+
reservoir
35+
states_modifiers
36+
readout
3737
end
3838

3939
function initialparameters(rng::AbstractRNG, rc::ReservoirComputer)

0 commit comments

Comments
 (0)