Expand description
This module works to provide the crate with various initialization methods suitable for machine-learning models.
Re-exports§
pub use rand_distr;
Modules§
Structs§
- Lecun
Normal - LecunNormal is a truncated normal distribution centered at 0
with a standard deviation that is calculated as
σ = sqrt(1/n_in)wheren_inis the number of input units. - Truncated
Normal - 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.
- Xavier
Normal - 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)) - Xavier
Uniform - 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.
- Init
Inplace - 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
RandomExttrait provided by thendarray_randcrate, however, it is designed to be more generic, extensible, and optimized for neural network initialization routines. Initialize is implemented forArrayBaseas well asParamsBaseallowing 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