RandomTimeReversal#

class tonic.transforms.RandomTimeReversal(p: float = 0.5, flip_polarities: bool = True)[source]#

Reverses temporal order of events with probability p.

\[t_i' = max(t) - t_i\]
Parameters:
  • p (float) – probability of performing the flip

  • flip_polarities (bool) – if the time is reversed, also flip the polarities. True by default.

Example

>>> transform = tonic.transforms.RandomTimeReversal(p=0.3)