simple_cycle!
ReservoirComputing.simple_cycle! — Function
simple_cycle!([rng], reservoir_matrix, weight; signs = nothing)Adds a simple cycle in the reservoir_matrix, with given weight. The weight can be a single number or an array.
Arguments
rng: Random number generator. Default isUtils.default_rng()from WeightInitializers.reservoir_matrix: matrix to be changed.weight: weight to add as a simple cycle. Can be either a single number or an array.
Keyword arguments
signs: Controls sign flips. UseRandomSigns,RegularSigns, orIrrationalDigitSigns. Passnothingto leave signs unchanged. Default isnothing.
Examples
julia> matrix = zeros(Float32, 5, 5)
5×5 Matrix{Float32}:
0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0
0.0 0.0 0.0 0.0 0.0
julia> simple_cycle!(matrix, 1.0; signs = IrrationalDigitSigns())
5×5 Matrix{Float32}:
0.0 0.0 0.0 0.0 -1.0
-1.0 0.0 0.0 0.0 0.0
0.0 1.0 0.0 0.0 0.0
0.0 0.0 -1.0 0.0 0.0
0.0 0.0 0.0 -1.0 0.0