Regularizer

abstract class Regularizer

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.

Regularization penalties are applied on a per-layer basis. The exact API will depend on the layer, but many layers (e.g. Dense, Conv1D, Conv2D and Conv3D) have a unified API. These layers expose 3 keyword arguments:

  • kernel_regularizer: Regularizer to apply a penalty on the layer's kernel

  • bias_regularizer: Regularizer to apply a penalty on the layer's bias

  • activity_regularizer: Regularizer to apply a penalty on the layer's output

NOTE: The value returned by the activity_regularizer is divided by the input batch size so that the relative weighting between the weight regularizers and the activity regularizers does not change with the batch size.

Constructors

Regularizer
Link copied to clipboard
fun Regularizer()

Functions

apply
Link copied to clipboard
abstract fun apply(tf: Ops, input: Operand<Float>): Operand<Float>

Applies regularization to the input.

Inheritors

L2L1
Link copied to clipboard