Class L2
java.lang.Object
org.tensorflow.framework.regularizers.AbstractRegularizer
org.tensorflow.framework.regularizers.L1L2
org.tensorflow.framework.regularizers.L2
- All Implemented Interfaces:
Regularizer
A regularizer that applies a L2 (Ridge Regression) regularization penalty.
The L2 regularization penalty is computed as: loss = l2 * reduceSum(square(x))
-
Field Summary
Fields inherited from class AbstractRegularizer
DEFAULT_REGULARIZATION_PENALTY -
Constructor Summary
ConstructorsConstructorDescriptionL2()Create a regularizer that applies an L2 regularization penalty ofAbstractRegularizer.DEFAULT_REGULARIZATION_PENALTYand a name based on the class name.L2(float l2) Create a regularizer that applies an L1 regularization penalty and a name based on the class name.Create a regularizer that applies an L2 regularization penalty ofAbstractRegularizer.DEFAULT_REGULARIZATION_PENALTYCreate a regularizer that applies an L1 regularization penalty -
Method Summary
Methods inherited from class AbstractRegularizer
asLoss, getName
-
Constructor Details
-
L2
public L2()Create a regularizer that applies an L2 regularization penalty ofAbstractRegularizer.DEFAULT_REGULARIZATION_PENALTYand a name based on the class name. -
L2
Create a regularizer that applies an L2 regularization penalty ofAbstractRegularizer.DEFAULT_REGULARIZATION_PENALTY- Parameters:
name- the name for this AbstractRegularizer
-
L2
public L2(float l2) Create a regularizer that applies an L1 regularization penalty and a name based on the class name.- Parameters:
l2- the L2 regularization penalty- Throws:
IllegalArgumentException- if the l2 regularization factor is NaN or is infinite.
-
L2
Create a regularizer that applies an L1 regularization penalty- Parameters:
name- the name for this AbstractRegularizerl2- the L2 regularization penalty- Throws:
IllegalArgumentException- if the l2 regularization factor is NaN or is infinite.
-