Open nkaenzig opened 1 week ago
Closes #712
samplers
eva.DataModule
BalancedSampler
Just add this to the init_args of the DataModule in your yaml config:
init_args
DataModule
samplers: train: class_path: eva.core.data.samplers.classification.BalancedSampler init_args: num_samples: 10
(For online mode, specify the sampler in samplers.train:, while for offline mode in samplers.predict:).
samplers.train:
samplers.predict:
Make sure that shuffle: false for the dataloader config of the corresponding split.
shuffle: false
Closes #712
samplers
argument toeva.DataModule
, so we can enable custom samplers in the dataloaders.BalancedSampler
which supports balanced class sample data loading for classification tasks.How to use
Just add this to the
init_args
of theDataModule
in your yaml config:(For online mode, specify the sampler in
samplers.train:
, while for offline mode insamplers.predict:
).Make sure that
shuffle: false
for the dataloader config of the corresponding split.