Class MinMaxNorm
MinMaxNorm weight constraint. Constrains the weights incident to each hidden unit to have the norm between a lower bound and an upper bound.
Namespace: SiaNet.Constraints
Assembly: SiaNet.dll
Syntax
public class MinMaxNorm : BaseConstraint
Constructors
| Improve this Doc View SourceMinMaxNorm(Single, Single, Single, UInt32)
Initializes a new instance of the MinMaxNorm class.
Declaration
public MinMaxNorm(float minVale = 0F, float maxValue = 1F, float rate = 1F, uint axis = 0U)
Parameters
Type | Name | Description |
---|---|---|
System.Single | minVale | The minimum norm for the incoming weights. |
System.Single | maxValue | The maximum norm for the incoming weights. |
System.Single | rate | Rate for enforcing the constraint: weights will be rescaled to yield (1 - rate) * norm + rate * norm.clip(min_value, max_value). |
System.UInt32 | axis | Integer, axis along which to calculate weight norms. |
Properties
| Improve this Doc View SourceAxis
Integer, axis along which to calculate weight norms. For instance, in a Dense layer the weight matrix has shape (input_dim, output_dim), set axis to 0 to constrain each weight vector of length (input_dim,). In a Conv2D layer, the weight tensor has shape (output_depth, input_depth, rows, cols), set axis to [1, 2, 3] to constrain the weights of each filter tensor of size (input_depth, rows, cols).
Declaration
public uint Axis { get; set; }
Property Value
Type | Description |
---|---|
System.UInt32 | The axis. |
MaxValue
The maximum norm for the incoming weights.
Declaration
public float MaxValue { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The maximum value. |
MinValue
The minimum norm for the incoming weights.
Declaration
public float MinValue { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The minimum value. |
Rate
Rate for enforcing the constraint: weights will be rescaled to yield (1 - rate) * norm + rate * norm.clip(min_value, max_value). Effectively, this means that rate=1.0 stands for strict enforcement of the constraint, while rate<1.0 means that weights will be rescaled at each step to slowly move towards a value inside the desired interval.
Declaration
public float Rate { get; set; }
Property Value
Type | Description |
---|---|
System.Single | The rate. |