torchsig.transforms.functional.patch_shuffle

torchsig.transforms.functional.patch_shuffle(data: ndarray, patch_size: int, patches_to_shuffle: ndarray, rng: Generator | None = None) ndarray[source]

Apply shuffling of patches specified by num_patches.

This function divides the input data into patches of specified size and shuffles the data within each patch according to the provided indices.

Parameters:
  • data – (batch_size, vector_length, …)-sized data.

  • patch_size – Size of each patch to shuffle.

  • patches_to_shuffle – Index of each patch of size patch_size to shuffle.

  • rng – Random Generator to use. Defaults to None (new generator created internally).

Returns:

Data that has undergone patch shuffling.