Skip to content

Commit

Permalink
Merge pull request #239 from laserkelvin/normalizer-override-force
Browse files Browse the repository at this point in the history
Override force standard deviation with energy
  • Loading branch information
laserkelvin authored Jun 10, 2024
2 parents e41791e + 755fa84 commit 0c8b77d
Showing 1 changed file with 10 additions and 0 deletions.
10 changes: 10 additions & 0 deletions matsciml/models/base.py
Original file line number Diff line number Diff line change
Expand Up @@ -1974,6 +1974,16 @@ def _make_normalizers(self) -> dict[str, Normalizer]:
logger.warning(
"Energy normalization was specified, but not force. I'm adding it for you."
)
# in the case where the energy and force std values are mismatched,
# we override the force one with the energy one
if "energy" in normalizers and "force" in normalizers:
energy_std = normalizers["energy"].std
force_std = normalizers["force"].std
if energy_std != force_std:
normalizers["force"].std = energy_std
logger.warning(
"Force normalization std is overridden with the energy std."
)
return normalizers


Expand Down

0 comments on commit 0c8b77d

Please sign in to comment.