deepmd.pt.utils.dataloader

Module Contents

Classes

DpLoaderSet

A dataset for storing DataLoaders to multiple Systems.

BackgroundConsumer

A class that represents a thread of control.

BufferedIterator

Functions

setup_seed(seed)

collate_batch(batch)

get_weighted_sampler(training_data, prob_style[, sys_prob])

Attributes

log

_sentinel

QUEUESIZE

deepmd.pt.utils.dataloader.log[source]
deepmd.pt.utils.dataloader.setup_seed(seed)[source]
class deepmd.pt.utils.dataloader.DpLoaderSet(systems, batch_size, type_map, seed=10, shuffle=True)[source]

Bases: torch.utils.data.Dataset

A dataset for storing DataLoaders to multiple Systems.

Parameters:
sys_path

Path to the data system

batch_size

Max frame count in a batch.

type_map

Gives the name of different atom types

seed

Random seed for dataloader

shuffle

If the data are shuffled (Only effective in serial mode. Always shuffle in distributed data parallelism)

set_noise(noise_settings)[source]
__len__()[source]
__getitem__(idx)[source]
add_data_requirement(data_requirement: List[deepmd.utils.data.DataRequirementItem])[source]

Add data requirement for each system in multiple systems.

print_summary(name: str, prob: List[float])[source]
deepmd.pt.utils.dataloader._sentinel[source]
deepmd.pt.utils.dataloader.QUEUESIZE = 32[source]
class deepmd.pt.utils.dataloader.BackgroundConsumer(queue, source, max_len)[source]

Bases: threading.Thread

A class that represents a thread of control.

This class can be safely subclassed in a limited fashion. There are two ways to specify the activity: by passing a callable object to the constructor, or by overriding the run() method in a subclass.

run()[source]

Method representing the thread’s activity.

You may override this method in a subclass. The standard run() method invokes the callable object passed to the object’s constructor as the target argument, if any, with sequential and keyword arguments taken from the args and kwargs arguments, respectively.

class deepmd.pt.utils.dataloader.BufferedIterator(iterable)[source]
_create_consumer()[source]
__iter__()[source]
__len__()[source]
__next__()[source]
deepmd.pt.utils.dataloader.collate_batch(batch)[source]
deepmd.pt.utils.dataloader.get_weighted_sampler(training_data, prob_style, sys_prob=False)[source]