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

hpo_default

The default strategy for optimizing the regularizer's hyper-parameters

normalize

Methods Summary

forward(x)

Compute the regularization term for one tensor.

Attributes Documentation

hpo_default: ClassVar[Mapping[str, Any]] = {'regularizers': (), 'total_weight': {'high': 1.0, 'low': 0.01, 'scale': 'log', 'type': <class 'float'>}}

The default strategy for optimizing the regularizer’s hyper-parameters

normalize

Methods Documentation

forward(x)[source]

Compute the regularization term for one tensor.

Return type:

FloatTensor

Parameters:

x (FloatTensor) –