rand_hyper
ReservoirComputing.rand_hyper — Function
rand_hyper([rng], [T], dims...;
poincare_dim=2, disk_radius=0.99, top_k=0, sigma=1.0, radius=1.0, return_sparse=false)Create a hyperbolic embedding reservoir matrix using the HYPER construction as described in (Singh et al., 2025).
This initializer samples reservoir nodes in a Poincaré ball of dimension poincare_dim, computes geometry-aware kernel weights, optionally sparsifies the rows to keep the top top_k connections, and scales the spectral radius to radius.
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
poincare_dim: Dimension of the Poincaré ball. Default is 2disk_radius: Maximum Euclidean radius of nodes in the Poincaré ball. Default is 0.99top_k: Number of largest entries to keep per row (integer). Default is 0sigma: Kernel width controlling decay of weights based on hyperbolic distance. Default is 1.0radius: Target spectral radius after scaling. Default is 1.0return_sparse: flag for returning asparsematrix.truerequiresSparseArraysto be loaded. Default isfalse
Examples
Default call:
julia> rng = MersenneTwister(123);
julia> dense_matrix = rand_hyper(rng, 5, 5; top_k=2);
julia> sparse_matrix = rand_hyper(MersenneTwister(123), 5, 5;
top_k=2, return_sparse=true);
julia> size(dense_matrix) == size(sparse_matrix) == (5, 5) &&
all(count(!iszero, dense_matrix[i, :]) <= 2 for i in axes(dense_matrix, 1)) &&
sparse_matrix isa SparseMatrixCSC{Float32}
trueReferences
- Singh, P.; Ghosh, S.; Kumar, A.; P, H. B. and Raman, B. (2025). HypER: Hyperbolic Echo State Networks for Capturing Stretch-and-Fold Dynamics in Chaotic Flows, arXiv preprint arXiv:2508.18196.