Expand description
this module establishes generic random initialization routines for models, params, and tensors.
§concision-init
This library provides various random distribution and initialization routines for the
concision framework. It includes implementations for different initialization strategies
optimized for neural networks, such as Glorot (Xavier) initialization, LeCun
initialization, etc.
Modules§
- distr
- this module implements various random distributions optimized for neural network initialization.
- error
- rand
- Utilities for random number generation
- rand_
distr - Generating random samples from probability distributions.
Structs§
- Lecun
Normal - 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. - 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.
Enums§
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