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