Skip to content

Commit c121f1a

Browse files
feat: add warning in weighted_init for change of res_size
feat: add warning in `weighted_init` for change of `res_size`
2 parents 6c0e58b + 3d72208 commit c121f1a

File tree

2 files changed

+9
-1
lines changed

2 files changed

+9
-1
lines changed

Project.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -28,7 +28,7 @@ Adapt = "4.1.1"
2828
Aqua = "0.8"
2929
CellularAutomata = "0.0.2"
3030
Compat = "4.16.0"
31-
DifferentialEquations = "7.15.0"
31+
DifferentialEquations = "7.16.1"
3232
LIBSVM = "0.8"
3333
LinearAlgebra = "1.10"
3434
MLJLinearModels = "0.9.2, 0.10"

src/esn/esn_inits.jl

Lines changed: 8 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -89,6 +89,14 @@ function weighted_init(rng::AbstractRNG, ::Type{T}, dims::Integer...;
8989
throw_sparse_error(return_sparse)
9090
approx_res_size, in_size = dims
9191
res_size = Int(floor(approx_res_size / in_size) * in_size)
92+
if res_size != approx_res_size
93+
@warn """Reservoir size has changed!\n
94+
Computed reservoir size ($res_size) does not equal the \
95+
provided reservoir size ($approx_res_size). \n
96+
Using computed value ($res_size). Make sure to modify the \
97+
reservoir initializer accordingly. \n
98+
"""
99+
end
92100
layer_matrix = DeviceAgnostic.zeros(rng, T, res_size, in_size)
93101
q = floor(Int, res_size / in_size)
94102

0 commit comments

Comments
 (0)