giagrad.Tensor.sparse#
- Tensor.sparse(sparsity, std=0.01) Tensor [source]#
Fills the 2D Tensor data as a sparse matrix.
Non-zero elements will be drawn from the normal distribution \(\mathcal{N}(0, \text{sigma})\), as described in Deep learning via Hessian-free optimization - Martens, J. (2010).
- Parameters:
Examples
>>> Tensor.empty(3, 5).sparse(sparsity=0.4, std=0.2)