peal.data.dataloaders.create_dataloaders_from_datasource¶
- peal.data.dataloaders.create_dataloaders_from_datasource(config, datasource=None, enable_hints=False, test_config=None)[source]¶
Create the train/val/test dataloaders for a config from a datasource.
- Parameters:
config (
object) – Config with adata(ordata_config) section and optionallytraining,task,predictor(dict withtrainingandtaskyaml paths, used when notrainingsection exists) andtransition_restrictions(its first entry becomes a class restriction on the train and val sets).datasource (
strortupleorlist, optional) – A dataset root passed toget_datasets, a tuple of two or threeDatasetobjects, or a tuple of two or threeDataLoaderobjects returned as-is. Defaults todata_config.dataset_path.enable_hints (
bool, optional) – Callenable_hintson the training dataset.test_config (
object, optional) – Forwarded toget_datasetsfor a differently configured test set.
- Returns:
(train_dataloader, val_dataloader, test_dataloader); a member isNonewhen its dataset is empty. Training loaders areDataloaderMixerinstances whensteps_per_epochis set.- Return type:
Notes
As a side effect
config.datais replaced by the training dataset’s config when that dataset is notmulticlass. An unrecognizeddatasourceprints a message and callsquit().