Skip to content

handle weighted forces in pytorch test entry point#12

Draft
caic99 wants to merge 2 commits intodevelfrom
codex/update-test_ener-to-handle-masked-forces-tkzu2y
Draft

handle weighted forces in pytorch test entry point#12
caic99 wants to merge 2 commits intodevelfrom
codex/update-test_ener-to-handle-masked-forces-tkzu2y

Conversation

@caic99
Copy link
Owner

@caic99 caic99 commented Aug 26, 2025

Summary

  • support atom_pref weights in test_ener and report both weighted and unweighted force errors
  • add PyTorch unit test verifying weighted-force handling

Testing

  • pytest source/tests/pt/test_dp_test.py::TestDPTestSeA::test_dp_test_1_frame source/tests/pt/test_dp_test.py::TestDPTestSeASpin::test_dp_test_1_frame source/tests/pt/test_dp_test.py::TestDPTestPropertySeA::test_dp_test_1_frame source/tests/pt/test_dp_test.py::TestDPTestForceWeight::test_force_weight -q (fails: This deepmd-kit package was compiled with CXX11_ABI_FLAG=0, but PyTorch runtime was compiled with CXX11_ABI_FLAG=1)

https://chatgpt.com/codex/tasks/task_b_689de8068a9c8332aa2a402469da6293

Comment on lines +425 to +431
masked_diff = diff_f[mask]
if masked_diff.size > 0:
mae_f = np.mean(np.abs(masked_diff))
rmse_f = np.sqrt(np.mean(masked_diff * masked_diff))
else:
mae_f = 0.0
rmse_f = 0.0
Copy link
Owner Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

@anyangml please check if this is what you mean

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

1 participant