CombinedRegularizer

class CombinedRegularizer(regularizers, total_weight=1.0, **kwargs)[source]

Bases: Regularizer

A convex combination of regularizers.

Initialize the regularizer.

Parameters
  • regularizers (Iterable[Regularizer]) – the base regularizers

  • total_weight (float) – the total regularization weight distributed to the base regularizers according to their individual weights

  • kwargs – additional keyword-based parameters passed to Regularizer.__init__()

Raises

TypeError – if any of the regularizers are a no-op regularizer

Attributes Summary

normalize

Methods Summary

forward(x)

Compute the regularization term for one tensor.

Attributes Documentation

normalize

Methods Documentation

forward(x)[source]

Compute the regularization term for one tensor.

Return type

FloatTensor

Parameters

x (FloatTensor) –