minimal_init
ReservoirComputing.minimal_init — Function
minimal_init([rng], [T], dims...; weight = 0.1, signs = nothing)Create a dense matrix with magnitudes determined by weight (Rodan and Tino, 2011). An optional sign pattern controls which weights have their signs flipped.
Arguments
rng: Random number generator. Default isUtils.default_rng()from WeightInitializers.T: Type of the elements in the reservoir matrix. Default isFloat32.dims: Dimensions of the matrix. Should followres_size x in_size.
Keyword arguments
weight: The weight used to fill the layer matrix. Default is 0.1.signs: Controls sign flips. UseRandomSigns,RegularSigns, orIrrationalDigitSigns. Passnothingto leave signs unchanged. Default isnothing.
Examples
Standard call:
julia> using Random
julia> using ReservoirComputing: IrrationalDigitSigns, RandomSigns, minimal_init
julia> res_input = minimal_init(MersenneTwister(14), Float32, 8, 3);
julia> size(res_input) == (8, 3) && all(abs.(res_input) .== 0.1f0)
trueApplying a sign pattern from an irrational number:
julia> res_input = minimal_init(
MersenneTwister(15), Float32, 8, 3; signs = IrrationalDigitSigns());
julia> size(res_input) == (8, 3) && all(abs.(res_input) .== 0.1f0)
trueChanging the probability of preserving each sign
julia> low_probability = minimal_init(
MersenneTwister(16), Float32, 8, 3; signs = RandomSigns(0.1));
julia> high_probability = minimal_init(
MersenneTwister(16), Float32, 8, 3; signs = RandomSigns(0.8));
julia> count(>(0), low_probability) < count(>(0), high_probability)
trueReferences
- Rodan, A. and Tino, P. (2011). Minimum Complexity Echo State Network. IEEE Transactions on Neural Networks 22, 131–144.