chemprop.data.dataloader#
Attributes#
Functions#
|
Return a |
Module Contents#
- chemprop.data.dataloader.logger#
- chemprop.data.dataloader.build_dataloader(dataset, batch_size=64, num_workers=0, class_balance=False, seed=None, shuffle=True, drop_last=None, **kwargs)[source]#
Return a
DataLoaderforMolGraphDatasets- Parameters:
dataset (MoleculeDataset | ReactionDataset | MulticomponentDataset) – The dataset containing the molecules or reactions to load.
batch_size (int, default=64) – the batch size to load.
num_workers (int, default=0) – the number of workers used to build batches.
class_balance (bool, default=False) – Whether to perform class balancing (i.e., use an equal number of positive and negative molecules). Class balance is only available for single task classification datasets. Set shuffle to True in order to get a random subset of the larger class.
seed (int, default=None) – the random seed to use for shuffling (only used when shuffle is True).
shuffle (bool, default=True) – whether to shuffle the data during sampling.
drop_last (bool, default=None) – Whether to drop the last batch if it is of size 1 (needed if using batchnorm during training). If None, this will be set automatically.