From 216579598a59b3ba1ef26ccd9bc02297708e2e8a Mon Sep 17 00:00:00 2001 From: MartinuzziFrancesco Date: Tue, 27 Feb 2024 19:42:04 +0100 Subject: [PATCH] format --- src/ReservoirComputing.jl | 3 ++- src/esn/esn_reservoirs.jl | 5 ++--- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ReservoirComputing.jl b/src/ReservoirComputing.jl index 26c5d3a8..78bf4f28 100644 --- a/src/ReservoirComputing.jl +++ b/src/ReservoirComputing.jl @@ -94,7 +94,8 @@ for initializer in (:rand_sparse, :delay_line, :delay_line_backward, :cycle_jump ::Type{T}; kwargs...) where {T <: $NType} return WeightInitializers.__partial_apply($initializer, ((rng, T), (; kwargs...))) end - @eval ($initializer)(; kwargs...) = WeightInitializers.__partial_apply($initializer, (; kwargs...)) + @eval ($initializer)(; kwargs...) = WeightInitializers.__partial_apply( + $initializer, (; kwargs...)) end #general diff --git a/src/esn/esn_reservoirs.jl b/src/esn/esn_reservoirs.jl index 2c37dbee..ef151084 100644 --- a/src/esn/esn_reservoirs.jl +++ b/src/esn/esn_reservoirs.jl @@ -25,9 +25,8 @@ function rand_sparse(rng::AbstractRNG, radius = T(1.0), sparsity = T(0.1), std = T(1.0)) where {T <: Number} - - lcl_sparsity = T(1)-sparsity #consistency with current implementations - reservoir_matrix = sparse_init(rng, T, dims...; sparsity=lcl_sparsity, std=std) + lcl_sparsity = T(1) - sparsity #consistency with current implementations + reservoir_matrix = sparse_init(rng, T, dims...; sparsity = lcl_sparsity, std = std) rho_w = maximum(abs.(eigvals(reservoir_matrix))) reservoir_matrix .*= radius / rho_w if Inf in unique(reservoir_matrix) || -Inf in unique(reservoir_matrix)