clinicadl.split.Split¶
- class clinicadl.split.Split(index: int, train_dataset: Dataset, val_dataset: Dataset, split_dir: Path | None = None)[source]¶
An object containing the data associated to a split.
More precisely, the dataclass contains the training and validation
Dataset, as well as the split index and the split directory used to split the dataset.Then, when
build_train_loader()andbuild_val_loader()has been called, the training and validationDataLoadercan be accessed.- property train_loader: DataLoader¶
The training dataloader.
- property val_loader: DataLoader¶
The validation dataloader.
- build_train_loader(*, batch_size: int = 1, sampling_weights: str | None = None, shuffle: bool = True, num_workers: int = 0, pin_memory: bool = True, drop_last: bool = False, prefetch_factor: int | None = None, persistent_workers: bool = False, collate_fn: CollateFn | None = None) None[source]¶
Builds a
DataLoaderfor the training set of the split.See
DataLoaderfor a description of the parameters.
- build_val_loader(*, batch_size: int = 1, sampling_weights: str | None = None, shuffle: bool = False, num_workers: int = 0, pin_memory: bool = True, drop_last: bool = False, prefetch_factor: int | None = None, persistent_workers: bool = False, collate_fn: CollateFn | None = None) None[source]¶
Builds a
DataLoaderfor the validation set of the split.See
DataLoaderfor a description of the parameters.