xnn.ffnn.models.classical_train#

The kernels of classical_kernels differentiable twice, for training: the per-atom energies of the pair and bonded terms with the gradients of their parameter arrays, and the position gradients as a function that is itself differentiable (force losses, Hessian-vector products). The second derivatives run the generated kernels of classical_tangents: the backward kernel’s tangent along the incoming direction (the Hessian-vector product), the forward kernel’s tangent (the gradient of the incoming energy gradients) and the tangent of the parameter adjoint (the parameter part of a force loss). The cell enters as a constant: a stress loss takes the reference terms.

Functions

bonded_terms_twice(pos, cell, batch, idx, ...)

bonded_terms() through BondedTermsTwice.

pair_terms_twice(pos, cell, batch, src, dst, ...)

pair_terms() through PairTermsTwice.

Classes

BondedTermsTwice(*args, **kwargs)

BondedTerms differentiable twice in the positions and once more in the float parameter arrays (the cell a constant).

PairTermsTwice(*args, **kwargs)

PairTerms differentiable twice in the positions and once more in the charges q and the table (the cell a constant).