Skip to content

Commit

Permalink
ignore drdq when generalized force loss is not set (#2807)
Browse files Browse the repository at this point in the history
This PR fixes an error for the example in the `examples` directory.
  • Loading branch information
njzjz authored Sep 12, 2023
1 parent 13d49bd commit 8cd822e
Showing 1 changed file with 8 additions and 7 deletions.
15 changes: 8 additions & 7 deletions deepmd/loss/ener.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,13 +121,14 @@ def __init__(
)
# drdq: the partial derivative of atomic coordinates w.r.t. generalized coordinates
# TODO: could numb_generalized_coord decided from the training data?
add_data_requirement(
"drdq",
self.numb_generalized_coord * 3,
atomic=True,
must=False,
high_prec=False,
)
if self.has_gf > 0:
add_data_requirement(
"drdq",
self.numb_generalized_coord * 3,
atomic=True,
must=False,
high_prec=False,
)
if self.enable_atom_ener_coeff:
add_data_requirement(
"atom_ener_coeff",
Expand Down

0 comments on commit 8cd822e

Please sign in to comment.