ConstantInitializationStrategy<T>
Models & Types · AiDotNet.Initialization
Constant initialization strategy that sets every weight to one value and every bias to zero.
Inheritance: InitializationStrategyBase<T> → ConstantInitializationStrategy<T>
For Beginners
Most weights start random so that units learn different things. A few parameters are meant to start at a known value instead, like a scale that should begin as “leave the input unchanged” (1). This strategy starts every weight at that value.
How It Works
This is nn.init.constant_(w, value): the starting point of parameters that a paper defines as a constant, such
as a normalization scale of one or a learnable attention temperature of one.
Constructors
| Constructor | Summary |
|---|---|
ConstantInitializationStrategy(double value) |
Initializes a new instance that fills weights with value. |
Properties
| Property | Summary |
|---|---|
bool IsLazy { get; } |
|
bool LoadFromExternal { get; } |
|
double Value { get; } |
Gets the value every weight starts at. |
Methods
| Method | Summary |
|---|---|
void InitializeBiases(Tensor<T> biases) |
|
void InitializeWeights(Tensor<T> weights, int inputSize, int outputSize) |