HalfBounding

class HalfBounding(*args, **kwargs)[source]

Bases: Protocol

Callable used to apply bounding to the lower or upper limit of a parameter.

Parameters:
  • param (torch.Tensor) – value of the parameter being bound.

  • update (torch.Tensor) – value of the partial update to scale.

  • limit (float) – maximum or minimum value of the updated parameter.

Returns:

bounded update.

Return type:

torch.Tensor