espaloma.data.dataset.GraphDataset
- class espaloma.data.dataset.GraphDataset(graphs=[], first=None)[source]
Bases:
espaloma.data.dataset.DatasetDataset with additional support for only viewing certain attributes as torch.utils.data.DataLoader
- view(collate_fn, \*args, \*\*kwargs)[source]
Provide a torch.utils.data.DataLoader view of the dataset.
- Note()
Methods
__init__([graphs, first])apply(fn[, in_place])Apply functions to the elements of the dataset.
batch(graphs)load(path)Load path to dataset.
regenerate_impropers([improper_def])Regenerate the improper nodes for all graphs.
save(path)Save dataset to path.
shuffle([seed])split(partition)Split the dataset according to some partition.
subsample(ratio[, seed])Subsample the dataset according to some ratio.
view([collate_fn])Provide a data loader.
- apply(fn, in_place=False)
Apply functions to the elements of the dataset.
- Parameters
fn (callable)
Note
If in_place is False, fn is added to the transforms else it is applied to elements and modifies them.
- regenerate_impropers(improper_def='smirnoff')
Regenerate the improper nodes for all graphs.
- Parameters
improper_def (str) – Which convention to use for permuting impropers.
- split(partition)
Split the dataset according to some partition.
- Parameters
partition (sequence of integers or floats)
- subsample(ratio, seed=None)
Subsample the dataset according to some ratio.
- Parameters
ratio (float) – Ratio between the size of the subsampled dataset and the original dataset.