Skip to content

Commit 2ab7b8f

Browse files
feat: add warning in weighted_init for change of res_size
1 parent 6c0e58b commit 2ab7b8f

File tree

1 file changed

+8
-0
lines changed

1 file changed

+8
-0
lines changed

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)