chemprop.data.samplers
#
Module Contents#
Classes#
A :class`SeededSampler` is a class for iterating through a dataset in a randomly seeded |
|
A |
- class chemprop.data.samplers.SeededSampler(N, seed)[source]#
Bases:
torch.utils.data.Sampler
A :class`SeededSampler` is a class for iterating through a dataset in a randomly seeded fashion
- Parameters:
N (int)
seed (int)
- class chemprop.data.samplers.ClassBalanceSampler(Y, seed=None, shuffle=False)[source]#
Bases:
torch.utils.data.Sampler
A
ClassBalanceSampler
samples data from aMolGraphDataset
such that positive and negative classes are equally sampled- Parameters:
dataset (MolGraphDataset) – the dataset from which to sample
seed (int) – the random seed to use for shuffling (only used when shuffle is True)
shuffle (bool, default=False) – whether to shuffle the data during sampling
Y (numpy.ndarray)