add_weights_regularizer

tflearn.helpers.regularizer.add_weights_regularizer (variable, loss='L2', weight_decay=0.001, add_to_collection=None)

Add a weights regularizer to the provided Tensor

Arguments

  • variable: Variable. Tensor to add regularization.
  • loss: str. Regularization mode.
  • weight_decay: float. Decay to use for regularization.
  • add_to_collection: str. Add the regularization loss to the specified collection. Default: tf.GraphKeys.REGULARIZATION_LOSSES.

Returns

tf.Tensor. The weight regularizer.