espaloma.data.dataset.GraphDataset

class espaloma.data.dataset.GraphDataset(graphs=[], first=None)[source]

Bases: espaloma.data.dataset.Dataset

Dataset 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()
__init__(graphs=[], first=None)[source]

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.

classmethod load(path)[source]

Load path to dataset.

regenerate_impropers(improper_def='smirnoff')

Regenerate the improper nodes for all graphs.

Parameters

improper_def (str) – Which convention to use for permuting impropers.

save(path)[source]

Save dataset to path.

Parameters

path (path-like object)

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.

view(collate_fn='graph', *args, **kwargs)[source]

Provide a data loader.

Parameters

collate_fn (callable or string) – see collate_fn argument for torch.utils.data.DataLoader