FullBounding

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

Bases: Protocol

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

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

  • pos (torch.Tensor) – value of the positive part of the update to scale.

  • neg (torch.Tensor) – value of the negative part of the update to scale.

  • max (float | None) – maximum value of the updated parameter.

  • min (float | None) – minimum value of the updated parameter.

Returns:

bounded update.

Return type:

torch.Tensor