xnn.ffnn.models.amber.AmberForceField#
- class xnn.ffnn.models.amber.AmberForceField(library, trainable=())[source]#
Bases:
ModuleThe trainable parameter tensors of an AMBER parameter library.
- Parameters:
library (AmberLibrary, str or Path) – The parameter library (or a shipped set such as
"ff94", a.frcpath or a native JSON path, seeread_amber()).trainable (sequence of str or "all", optional) – Groups to expose to the optimizer:
"rstar","epsilon","bond_k","bond_r0","angle_k","angle_theta0","dihedral_k","improper_k";"all"unfreezes every group.
- Variables:
params (torch.nn.ParameterDict) –
rstar(T,)in Angstrom,epsilon(T,)in eV,bond_k(NB,)in eV/A^2,bond_r0(NB,),angle_k(NA,)in eV/rad^2,angle_theta0(NA,)in rad,dihedral_k(ND, 4)andimproper_k(NI, 2)in eV (one column per Fourier term, zero where a row has fewer terms).dihedral_mask (dihedral_n, dihedral_cos, dihedral_sin,) – Periodicities, the cosine / sine of the phases and a 0/1 mask of the used term slots of the torsion rows (fixed buffers; a trained
dihedral_knever grows a term in an unused slot); likewiseimproper_n/improper_cos/improper_sin/improper_mask.improper_keys (type_names, bond_keys, angle_keys, dihedral_keys,) – Row labels of the parameter tensors.
fudge_qq (fudge_lj,) – The library’s 1,4 scaling factors.
- resolve_dihedral(a, b, c, d)[source]#
Dihedral-type row: the exact quadruple (either direction) wins over the
X-B-C-Xgeneric entry.
- resolve_improper(*args)[source]#
Improper-type row, by exact key or by the four classes in evaluation order (center third, distinguished atom last).
- Return type:
- export_library()[source]#
The current (possibly trained) parameters as an
AmberLibrary.- Returns:
In AMBER units (kcal/mol, Angstrom, degrees); the residue templates keep the library’s charges (trained per-atom charges belong to the models, see
Amber.export_library()).- Return type: