TrialSampler#

class torch_brain.data.sampler.TrialSampler(*, sampling_intervals, generator=None, shuffle=False)[source]#

Bases: torch.utils.data.sampler.Sampler

Randomly samples a single trial interval from the given intervals.

Parameters:
  • sampling_intervals (Dict[str, List[Tuple[int, int]]]) – Sampling intervals for each session in the dataset.

  • generator (Optional[torch.Generator], optional) – Generator for shuffling. Defaults to None.

  • shuffle (bool, optional) – Whether to shuffle the indices. Defaults to False.