regularizers module

class regularizers.L2Regularizer(reg_rate)

Bases: regularizers.Regularizer

L2 regularizer.

reg_rate

Regularization rate.

Type

float

__init__(reg_rate)

Constuctor.

loss(param)

Computes the regulariztion loss of the parameters such as layer loss in dense due to large weights.

grad(param)

Computes the gradient of the regularization term with respect to param.

__repr__()

Returns the string representation of class.

grad(param)

Computes the gradient of the regularization term with respect to param.

Parameters

param (numpy.ndarray) – The parameter tensor.

Returns

Regularization gradient with respect to param.

Return type

numpy.ndarray

Notes

None

loss(param)

Computes the regulariztion loss of the parameters such as layer loss in dense due to large weights.

Parameters

param (numpy.ndarray) – The parameter tensor.

Returns

Regularization loss.

Return type

float

Notes

None

class regularizers.Regularizer(reg_rate)

Bases: object

Regularizer parent class.

reg_rate

Regularization rate.

Type

float

__init__(reg_rate)

Constuctor.