You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Support the loss for generalized forces. Tests and examples have been
added.
Generalized forces are given by
```math
Q_j = \sum_{i=1}^n \mathbf F_i \cdot \frac {\partial \mathbf r_i} {\partial q_j},\quad j=1,\ldots, m.
```
The loss for generalized forces is given by
```math
L_Q = \frac{1}{m} \sum_{j=1}^m (Q_j - Q_j^*)^2.
```
In the example, the generalized coordinates $q$ are the restraint
coordinates in the enhanced sampling.
This PR also improves documentation for other arguments in the loss.
---------
Signed-off-by: Jinzhe Zeng <[email protected]>
returnf"The prefactor of {item} loss at the start of the training. Should be larger than or equal to 0. If set to none-zero value, the {item} label should be provided by file {item}.npy in each data system. If both start_pref_{item} and limit_pref_{item} are set to 0, then the {item} will be ignored."
980
+
defstart_pref(item, label=None, abbr=None):
981
+
iflabelisNone:
982
+
label=item
983
+
ifabbrisNone:
984
+
abbr=item
985
+
returnf"The prefactor of {item} loss at the start of the training. Should be larger than or equal to 0. If set to none-zero value, the {label} label should be provided by file {label}.npy in each data system. If both start_pref_{abbr} and limit_pref_{abbr} are set to 0, then the {item} will be ignored."
982
986
983
987
984
988
deflimit_pref(item):
985
989
returnf"The prefactor of {item} loss at the limit of the training, Should be larger than or equal to 0. i.e. the training step goes to infinity."
doc_numb_generalized_coord="The dimension of generalized coordinates. Required when generalized force loss is used."
999
1008
doc_relative_f="If provided, relative force error will be used in the loss. The difference of force will be normalized by the magnitude of the force in the label with a shift given by `relative_f`, i.e. DF_i / ( || F || + relative_f ) with DF denoting the difference between prediction and label and || F || denoting the L2 norm of the label."
1000
1009
doc_enable_atom_ener_coeff="If true, the energy will be computed as \\sum_i c_i E_i. c_i should be provided by file atom_ener_coeff.npy in each data system, otherwise it's 1."
0 commit comments