pseudo_svd
ReservoirComputing.pseudo_svd
— Functionpseudo_svd([rng], [T], dims...;
max_value=1.0, sparsity=0.1, sorted=true, reverse_sort=false,
return_sparse=false)
Returns an initializer to build a sparse reservoir matrix with the given sparsity
by using a pseudo-SVD approach as described in (Yang et al., 2018).
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 reservoir matrix.
Keyword arguments
max_value
: The maximum absolute value of elements in the matrix. Default is 1.0sparsity
: The desired sparsity level of the reservoir matrix. Default is 0.1sorted
: A boolean indicating whether to sort the singular values before creating the diagonal matrix. Default istrue
.reverse_sort
: A boolean indicating whether to reverse the sorted singular values. Default isfalse
.return_sparse
: flag for returning asparse
matrix. Default isfalse
.return_diag
: flag for returning aDiagonal
matrix. If bothreturn_diag
andreturn_sparse
are set totrue
priority is given toreturn_diag
. Default isfalse
.
Examples
julia> res_matrix = pseudo_svd(5, 5)
5×5 Matrix{Float32}:
0.306998 0.0 0.0 0.0 0.0
0.0 0.325977 0.0 0.0 0.0
0.0 0.0 0.549051 0.0 0.0
0.0 0.0 0.0 0.726199 0.0
0.0 0.0 0.0 0.0 1.0
References
- Yang, C.; Qiao, J.; Han, H. and Wang, L. (2018). Design of polynomial echo state networks for time series prediction. Neurocomputing 290, 148–160.