Lasso#
- class vulkpy.nn.Lasso#
Bases:
Regularizer
Lasso (L1) Regularization
Notes
\[\begin{split}L = \text{coeff} \times \sum_i |W_i|\\ dL/dW_i = \text{coeff} \times \rm{sign}(W_i)\end{split}\]Methods Summary
Methods Documentation
- grad(param: Array) Array #
Gradient of L1 Regularization Loss
- Parameters:
param (vulkpy.Array) – Parameter
- Returns:
dW – Gradient for L1 Regularization Loss
- Return type:
- loss(param: Array) Array #
L1 Regularization Loss
- Parameters:
param (vulkpy.Array) – Parameter
- Returns:
loss – L1 Regularization Loss
- Return type:
- __init__(coeff: float = 1.0)#
Initialize Lasso Regularizer
- Parameters:
coeff (float, optional) – L1 Coefficient