Regularizer#

class vulkpy.nn.Regularizer#

Bases: object

Abstract base class for Regularizer

See also

vulkpy.nn.Lasso

Lasso (L1) Regularizer

vulkpy.nn.Ridge

Ridge (L2) Regularizer

vulkpy.nn.Elastic

Elastic (L1 + L2) Regularizer

Notes

Subclass must implement loss() and grad().

Methods Summary

grad(param)

Compute Gradient

loss(param)

Compute Regularizer Loss

Methods Documentation

grad(param: Array) Array#

Compute Gradient

Parameters:

param (vulkpy.Array) – Parameters

Returns:

grad – Gradient

Return type:

vulkpy.Array

Notes

Subclass must implement this method.

loss(param: Array) Array#

Compute Regularizer Loss

Parameters:

param (vulkpy.Array) – Parameters

Returns:

loss – Loss

Return type:

vulkpy.Array

Notes

Subclass must implement this method.

__init__()#