xnn.dnn.models.hdnnp.NNP1G#
- class xnn.dnn.models.hdnnp.NNP1G(species, hidden=(30, 30), activation='tanh', coordinates='distances', length=1.0, symmetrize=False, max_permutations=5040, cutoff=1.0)[source]#
Bases:
InteratomicPotentialFirst-generation neural network potential: one network for the whole system.
The low-dimensional potentials that preceded the HDNNP map a fixed set of coordinates of a fixed system directly to its energy with a single feed-forward network (Blank et al. 1995, Lorenz et al. 2004; Fig. 1 and eq. 1 of Behler and Parrinello 2007). Here the coordinates are the
n (n - 1) / 2interatomic distances of a system ofnatoms in a fixed order (or a function of them), so the energy is invariant to translations and rotations. As in those potentials the network is tied to its number of atoms and their order;symmetrize=Truemakes it invariant under permutations of like atoms by averaging the network over all of them (exact, at one evaluation per permutation).- Parameters:
species (sequence of int) – Atomic number of every atom, in the order the structures list them.
hidden (sequence of int, optional) – Hidden-layer widths, by default
(30, 30).activation (str, optional) – Hidden-layer activation, by default
"tanh"(the output is linear).coordinates (str, optional) – Network inputs:
"distances"(default)r_ij,"inverse_distances"1 / r_ijor"exponential"exp(-r_ij / length).length (float, optional) – Length scale of the
"exponential"coordinates, by default 1.0.symmetrize (bool, optional) – Average over every permutation of like atoms, by default
False.max_permutations (int, optional) – Largest permutation group accepted with
symmetrize, by default 5040.cutoff (float, optional) – Neighbour-list radius of the data pipeline; the model reads positions only. By default 1.0.
- Variables:
n_atoms (int) – Number of atoms of the system.
net (torch.nn.Sequential) – The network.
input_std (input_mean,) – Standardization of the inputs (
fit_scaling()).energy_scale (energy_shift,) –
E = energy_shift + energy_scale * net(x).
- inputs(data)[source]#
The coordinates of every structure,
(B, n_atoms (n_atoms - 1) / 2).- Parameters:
data (AtomicGraph)
- Return type:
- forward(data)[source]#
Energy of each structure; the per-atom energies are its equal shares.
- Parameters:
data (AtomicGraph) – Batched structures of the model’s atoms.
- Returns:
node_energyandenergy.- Return type:
- fit_scaling(graphs)[source]#
Standardize the inputs and the energy on training structures.
The input statistics are taken over every permuted copy, so they are the same for like-atom pairs and keep a symmetrized model invariant.
- Parameters:
graphs (iterable of AtomicGraph) – Training structures with energies.
- Return type:
None