Table of Contents

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

param T

The parameter value to adjust.

paramGradient T

The gradient of the parameter to adjust.

Type Parameters

T

The 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

param T

The value used to report the penalty.

Returns

float

The reported penalty value.

Type Parameters

T

The 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

param T

The parameter value to update.

Type Parameters

T

The type of the parameter to update. Must be a non-null type.