-
Notifications
You must be signed in to change notification settings - Fork 584
fix(dpmodel): rmse_e loss normalized by n_atoms #5124
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Conversation
Consistent with other backends.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull request overview
This PR fixes the RMSE energy loss calculation in the dpmodel backend to normalize by the number of atoms, making it consistent with other backends (PyTorch, PaddlePaddle, and TensorFlow).
Key Changes:
- Normalized
rmse_emetric by multiplying withatom_norm_ener(1.0 / natoms) - Ensures cross-backend consistency for energy RMSE reporting
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📝 WalkthroughWalkthroughThe change modifies the EnergyLoss.call method in deepmd/dpmodel/loss/ener.py to scale the observable RMSE for energy by atom_norm_ener (1.0 / natoms) when displaying the value. The underlying loss calculation and accumulation remain unchanged. Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~8 minutes Possibly related PRs
Suggested labels
Suggested reviewers
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
📜 Recent review detailsConfiguration used: Repository UI Review profile: CHILL Plan: Pro 📒 Files selected for processing (1)
🧰 Additional context used🧠 Learnings (3)📓 Common learnings📚 Learning: 2024-10-08T15:32:11.479ZApplied to files:
📚 Learning: 2024-10-05T03:06:02.372ZApplied to files:
⏰ Context from checks skipped due to timeout of 90000ms. You can increase the timeout in your CodeRabbit configuration to a maximum of 15 minutes (900000ms). (30)
🔇 Additional comments (1)
Thanks for using CodeRabbit! It's free for OSS, and your support helps us grow. If you like it, consider giving us a shout-out. Comment |
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #5124 +/- ##
=======================================
Coverage 82.15% 82.15%
=======================================
Files 709 709
Lines 72468 72468
Branches 3616 3615 -1
=======================================
Hits 59535 59535
Misses 11769 11769
Partials 1164 1164 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Consistent with other backends.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.