Reflect

class deepinv.transform.Reflect(*args, dim: int | list[int] = [-2, -1], **kwargs)[source]

Bases: Transform

Reflect (flip) in random multiple axes.

Generates n_trans reflected images, each time subselecting axes from dim (without replacement). Hence to transform through all group elements, set n_trans to 2**len(dim) e.g Reflect(dim=[-2, -1], n_trans=4)

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

Parameters:
  • dim (int, list[int]) – axis or axes on which to randomly select axes to reflect.

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

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

Examples using Reflect:

Image transforms for equivariance & augmentations

Image transforms for equivariance & augmentations