Augmentation and sampling
Use this route when augmentations, Transform composition,
AugmentedDataLoader, n_augmentation, sequence sampling, relative
positioning, or self-supervised sampling is the main task.
Workflow
- Confirm batches are
(X, y)withXshaped(batch, channels, time)and that labels remain aligned after each transform. - Build a
TransformorComposewith an explicit probability and random state. Test it on one batch and verify shape, dtype, device, and label invariants. - Use
AugmentedDataLoaderfor training batches. Remember thatn_augmentation=0preserves the original batch; positive values append transformed copies after clean originals and tile labels accordingly. - Choose sequence/relative-positioning/self-supervised samplers only when the dataset contains the required trial/session/window metadata. Verify indices and split boundaries before training.
- Use CPU first. Move both model and batches to CUDA only after a bounded allocation succeeds; a CUDA availability flag is not a memory guarantee.
Read API reference, sampling workflows,
and troubleshooting. Run the deterministic
augmentation smoke, which uses a local
TensorDataset and no network or credentials.
