chemprop.data.dataloader

chemprop.data.dataloader#

Module Contents#

Functions#

build_dataloader(dataset[, batch_size, num_workers, ...])

Return a DataLoader for MolGraphDatasets

chemprop.data.dataloader.build_dataloader(dataset, batch_size=64, num_workers=0, class_balance=False, seed=None, shuffle=True, **kwargs)[source]#

Return a DataLoader for MolGraphDatasets

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=False) – whether to shuffle the data during sampling.