Skip to content

semipy.datasets.utils.split_dataset

Warning

This section is in construction.

    semipy.datasets.utils.split_dataset(dataset,
                                        weak_transform=None,
                                        strong_transform=None,
                                        valid_proportion: float = 0.0,
                                        test_proportion: float = 0.0,
                                        num_classes: Optional[int] = None)

A function to split a MultiFolderDataset object with unlabelled items into train, test and validation sets. It also has the ability to apply two sets of differents data transformations (usually a weak and a strong augmentation).

Parameters

  • dataset - An iterable dataset to split.
  • weak_transform - A first torchvision.transforms.Compose list of data transformations. Default: None
  • strong_transform - A second torchvision.transforms.Compose list of data transformations. Default: None
  • valid_proportion (float) - Proportion of the validation set compared to the number of labelled samples. Default: 0.0
  • test_proportion (float) - Proportion of the test set compared to the number of labelled samples. Default: 0.0
  • num_classes (optional, [int]) - Number of classes in the dataset. Default: None