Augmentation¶
- class metatrain.utils.augmentation.O3Augmenter(target_info_dict: Dict[str, TargetInfo], extra_data_info_dict: Dict[str, TargetInfo] | None = None, group: str = 'O3')[source]¶
Bases:
objectApplies random O(3) transformations to a set of systems and their targets.
- Parameters:
target_info_dict (Dict[str, TargetInfo]) – A dictionary mapping target names to their corresponding
TargetInfoobjects.extra_data_info_dict (Dict[str, TargetInfo] | None) – An optional dictionary mapping extra data names to their corresponding
TargetInfoobjects.group (str) – which transformations
apply_random_augmentations()samples from:"O3"(the default) draws uniform rotations and improper rotations, while"inversions"draws only the identity and the inversion, for architectures that are already rotation-equivariant by construction.
- apply_random_augmentations(systems: List[System], targets: Dict[str, TensorMap], extra_data: Dict[str, TensorMap] | None = None) Tuple[List[System], Dict[str, TensorMap], Dict[str, TensorMap]][source]¶
Applies random O(3) augmentations to systems, targets, and optional extra data.
- apply_augmentations(systems: List[System], targets: Dict[str, TensorMap], transformations: List[Tensor], extra_data: Dict[str, TensorMap] | None = None) Tuple[List[System], Dict[str, TensorMap], Dict[str, TensorMap]][source]¶
Applies the given O(3) transformations to systems, targets, and optional extra data.
- Parameters:
targets (Dict[str, TensorMap]) – A dictionary mapping target names to
TensorMapobjects.transformations (List[Tensor]) – A list of 3x3 orthogonal
torch.Tensormatrices, one per system. Matrices with determinant -1 are improper rotations.extra_data (Dict[str, TensorMap] | None) – An optional dictionary of additional
TensorMapobjects to augment alongside targets.
- Returns:
A tuple of augmented systems, targets, and extra data.
- Return type:
Tuple[List[System], Dict[str, TensorMap], Dict[str, TensorMap]]