xnn.ffnn.models.dreiding.DreidingForceField#
- class xnn.ffnn.models.dreiding.DreidingForceField(library='dreiding', trainable=())[source]#
Bases:
ModuleThe trainable generator tensors of a DREIDING parameter set.
Assembles the library’s per-type generators and global rule constants into tensors (eV / Angstrom / radians) exposed as a
torch.nn.ParameterDict, so any group can be refit by gradient descent. One instance can be shared by severalDreidingmodels (different molecules) to train transferable parameters jointly.- Parameters:
library (DreidingLibrary, str or Path) – The parameter library (or a spec for
read_dreiding(); default specs are"dreiding"and"dreiding/X6").trainable (sequence of str or "all", optional) – Parameter groups to expose to the optimizer: any of
"radius","theta0","bond_k","bond_d","angle_k","torsion_v","oop_k","oop_psi0","vdw_r0","vdw_d0","x6_zeta","hbond_d0","hbond_r0";"all"unfreezes every group. Default: none (the fixed classical force field).
- Variables:
params (torch.nn.ParameterDict) –
radius(T,)A,theta0(T,)rad,bond_keV/A^2,bond_deV,angle_keV/rad^2,torsion_v(9,)eV (one total barrier per rule, inTORSION_RULESorder),oop_k(T,)eV/rad^2,oop_psi0(T,)rad,vdw_r0(T,)A,vdw_d0(T,)eV,x6_zeta(T,),hbond_d0eV andhbond_r0A.type_names (list of str) – Row labels of the per-type tensors.
form (str) –
"lj"or"x6".combination (str) – The LJ
R0combination rule ("arithmetic"or"geometric").
- check_generators(name)[source]#
Raise if a type lacks the per-type generators terms need.
- Parameters:
name (str)
- Return type:
None
- export_library()[source]#
Write the current (possibly trained) parameters back to a library.
- Returns:
A new library in DREIDING units (kcal/mol, Angstrom, degrees), round-trippable through
DreidingLibrary.save()/read_dreiding().- Return type: