reversesimplecycle!
ReservoirComputing.reverse_simple_cycle! — Function
reverse_simple_cycle!([rng], reservoir_matrix, weight; signs = nothing)Adds a reverse 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> reverse_simple_cycle!(matrix, 1.0; signs = RegularSigns())
5×5 Matrix{Float32}:
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
0.0 0.0 0.0 0.0 1.0
1.0 0.0 0.0 0.0 0.0