Auto3D.config.NNPModel
- class Auto3D.config.NNPModel(*args, **kwargs)
Bases:
ProtocolProtocol for Neural Network Potential models.
Custom NNP models must implement this interface to be compatible with Auto3D’s optimization engine.
Example
>>> class MyNNP(torch.nn.Module): ... coord_pad = 0 ... species_pad = -1 ... ... def forward(self, species, coords, charges): ... # Return energies tensor of shape (batch_size,) ... return energies
- __init__(*args, **kwargs)
Methods
__init__(*args, **kwargs)forward(species, coords, charges)Calculate energies for a batch of molecules.
Attributes
Padding value for coordinates in batched tensors.
Padding value for atomic species in batched tensors.
- forward(species: Tensor, coords: Tensor, charges: Tensor) Tensor
Calculate energies for a batch of molecules.
- Parameters:
species – Atomic numbers, shape (batch_size, max_atoms).
coords – Atomic coordinates, shape (batch_size, max_atoms, 3).
charges – Molecular charges, shape (batch_size,).
- Returns:
Energies tensor of shape (batch_size,) in eV.