Regularization Functions

The regularization functions are used to prevent overfitting by modifying the models objective function by adding additional terms that penalize large weights. This helps prevents the network from using weights that are redundant.

Function Descriptions

class ztlearn.regularizers.ElasticNetRegularization(_lambda, l1_ratio)[source]

Bases: object

Elastic Net Regularization (ElasticNetRegularization)

ElasticNetRegularization adds both absolute value of magnitude and squared magnitude of coefficient as penalty term to the loss function

References

[1] Regularization (mathematics)
Parameters:
  • _lambda (float32) – controls the weight of the penalty term
  • l1_ratio (float32) – controls the value l1 penalty as a ratio of total penalty added to the loss function
derivative(weights)[source]
regulate(weights)[source]
regulation_name
class ztlearn.regularizers.L1Regularization(_lambda, **kwargs)[source]

Bases: object

Lasso Regression (L1Regularization)

L1Regularization adds sum of the absolute value magnitudes of parameters as penalty term to the loss function

References

[1] Regularization (mathematics)
[2] Regression shrinkage and selection via the lasso
[3] Feature selection, L1 vs. L2 regularization, and rotational invariance
Parameters:_lambda (float32) – controls the weight of the penalty term
derivative(weights)[source]
regulate(weights)[source]
regulation_name
class ztlearn.regularizers.L2Regularization(_lambda, **kwargs)[source]

Bases: object

Lasso Regression (L2Regularization)

L1Regularization adds sum of the squared magnitudes of parameters as penalty term to the loss function

References

[1] Regularization (mathematics)
[2] Regression shrinkage and selection via the lasso
[3] Feature selection, L1 vs. L2 regularization, and rotational invariance
Parameters:_lambda (float32) – controls the weight of the penalty term
derivative(weights)[source]
regulate(weights)[source]
regulation_name
class ztlearn.regularizers.RegularizationFunction(name='lasso', _lambda=0.5, l1_ratio=0.5)[source]

Bases: object

derivative(weights)[source]
name
regulate(weights)[source]