ShiftTime#

class deepinv.transform.ShiftTime(*args, padding='reflect', **kwargs)[source]#

Bases: Transform

Shift a video in time with reflective padding.

Generates n_trans randomly transformed versions.

See deepinv.transform.Transform for further details and examples.

Parameters:
  • n_trans (int) – number of transformed versions generated per input image.

  • padding (str) – "reflect" performs reflective padding, "wrap" performs wrap padding (i.e. roll)

  • rng (torch.Generator) – random number generator, if None, use torch.Generator(), defaults to None

roll_reflect_1d(x: Tensor, by: int = 0, dim: int = 0)[source]#

Roll in one dimension with reflect padding.

Parameters:
  • x (torch.Tensor) – input image

  • by (int) – amount to roll by, defaults to 0

  • dim (int) – dimension to roll, defaults to 0