RandomChoice#

class torch_brain.transforms.RandomChoice(transforms, p=None)[source]#

Bases: object

Apply a single transformation randomly picked from a list.

Parameters:
  • transforms (list[Callable]) – list of transformations

  • p (Optional[list[float]]) – probability of each transform being picked. If p doesn’t sum to 1, it is automatically normalized. By default, all transforms have the same probability.