Class AbstractRegularizer

java.lang.Object
org.tensorflow.framework.regularizers.AbstractRegularizer
All Implemented Interfaces:
Regularizer
Direct Known Subclasses:
L1L2

public abstract class AbstractRegularizer extends Object implements Regularizer
Base class for Regularizers

Regularizers allow you to apply penalties on layer parameters or layer activity during optimization. These penalties are summed into the loss function that the network optimizes.

  • Field Details

    • DEFAULT_REGULARIZATION_PENALTY

      public static final float DEFAULT_REGULARIZATION_PENALTY
      See Also:
  • Constructor Details

    • AbstractRegularizer

      protected AbstractRegularizer()
      Creates a AbstractRegularizer, using Class.getSimpleName() for the name
    • AbstractRegularizer

      protected AbstractRegularizer(String name)
      Creates a AbstractRegularizer
      Parameters:
      name - the name of this regularizer, if null use Class.getSimpleName() for the name.
  • Method Details

    • asLoss

      public org.tensorflow.framework.losses.impl.AbstractLoss asLoss()
      Returns this AbstractRegularizer as a AbstractLoss This is a convenience to use regularize a loss. Only sampleWeights are applied to the regularizer.
      Returns:
      this AbstractRegularizer as a AbstractLoss
    • getName

      public String getName()
      Gets the name for this regularizer
      Returns:
      the name for this regularizer