Interface IRegularizer
- Namespace
- NeuralNetworks.Regularization
- Assembly
- NeuralNetworks.dll
Defines regularization operations for applying gradient-based adjustments, reporting penalty terms, and updating parameters after optimizer steps.
public interface IRegularizer
Remarks
Implementations encapsulate regularization strategy behavior used during and after optimization updates, including optional constraint projections.
Methods
ApplyGradient<T>(T, T)
Applies a gradient update using the specified parameter values and corresponding gradient values.
void ApplyGradient<T>(T param, T paramGradient) where T : notnull
Parameters
paramTThe parameter value to adjust.
paramGradientTThe gradient of the parameter to adjust.
Type Parameters
TThe type of the parameter and gradient. Must be a non-null type.
ReportPenalty<T>(T)
Reports a penalty for the specified value.
float ReportPenalty<T>(T param) where T : notnull
Parameters
paramTThe value used to report the penalty.
Returns
- float
The reported penalty value.
Type Parameters
TThe non-nullable type of value used to report the penalty.
UpdateParams<T>(T)
Applied to the parameters after the optimizer has updated them (e.g., for norm-constraint projections).
void UpdateParams<T>(T param) where T : notnull
Parameters
paramTThe parameter value to update.
Type Parameters
TThe type of the parameter to update. Must be a non-null type.