Module init

Source
Expand description

this module establishes generic random initialization routines for models, params, and tensors. This module works to provide the crate with various initialization methods suitable for machine-learning models.

Modules§

distr

Structs§

LecunNormal
LecunNormal is a truncated normal distribution centered at 0 with a standard deviation that is calculated as σ = sqrt(1/n_in) where n_in is the number of input units.
TruncatedNormal
A truncated normal distribution is similar to a normal distribution, however, any generated value over two standard deviations from the mean is discarded and re-generated.
XavierNormal
Normal Xavier initializers leverage a normal distribution with a mean of 0 and a standard deviation (σ) computed by the formula: σ = sqrt(2/(d_in + d_out))
XavierUniform
Uniform Xavier initializers use a uniform distribution to initialize the weights of a neural network within a given range.

Traits§

Init
A trait for creating custom initialization routines for models or other entities.
InitInplace
This trait enables models to implement custom, in-place initialization methods.
Initialize
This trait provides the base methods required for initializing tensors with random values. The trait is similar to the RandomExt trait provided by the ndarray_rand crate, however, it is designed to be more generic, extensible, and optimized for neural network initialization routines. Initialize is implemented for ArrayBase as well as ParamsBase allowing you to randomly initialize new tensors and parameters.

Functions§

randc
Generate a random array of complex numbers with real and imaginary parts in the range [0, 1)
stdnorm
Given a shape, generate a random array using the StandardNormal distribution
stdnorm_from_seed
uniform_from_seed
Creates a random array from a uniform distribution using a given key

Type Aliases§

UniformResult