deepdrivemd.models.aae_stream.utils

Functions

read_adios_file(input_path)

Classes

CenterOfMassTransform(data)

PointCloudDatasetInMemory(*args, **kwargs)

PyTorch Dataset class to load point cloud data.

class deepdrivemd.models.aae_stream.utils.CenterOfMassTransform(data: numpy.ndarray)
__init__(data: numpy.ndarray) None

Computes center of mass transformation :Parameters: data (np.ndarray) – Dataset of positions with shape (num_examples, 3, num_points).

transform(x: numpy.ndarray) numpy.ndarray

Normalize example by bias and scale factors :Parameters: x (np.ndarray) – Data to transform shape (3, num_points). Modifies x.

Returns

np.ndarray – The transformed data

Raises

ValueError – If NaN encountered in input

class deepdrivemd.models.aae_stream.utils.PointCloudDatasetInMemory(*args: Any, **kwargs: Any)

PyTorch Dataset class to load point cloud data. Optionally, uses HDF5 files to only read into memory what is necessary for one batch.

__init__(data: numpy.ndarray, scalars: Dict[str, numpy.ndarray] = {}, cms_transform: bool = False, scalar_requires_grad: bool = False)
Parameters
  • data (np.ndarray) – Dataset of positions with shape (num_examples, 3, num_points)

  • scalars (Dict[str, np.ndarray], default={}) – Dictionary of scalar arrays. For instance, the root mean squared deviation (RMSD) for each feature vector can be passed via {"rmsd": np.array(...)}. The dimension of each scalar array should match the number of input feature vectors N.

  • cms_transform (bool) – If True, subtract center of mass from batch and shift and scale batch by the full dataset statistics.

  • scalar_requires_grad (bool) – Sets requires_grad torch.Tensor parameter for scalars specified by scalar_dset_names. Set to True, to use scalars for learning. If scalars are only required for plotting, then set it as False.

deepdrivemd.models.aae_stream.utils.read_adios_file(input_path: pathlib.Path)