fix(dpmodel): fix rmse_* in more_loss#5105
Conversation
The previous value was MSE.
There was a problem hiding this comment.
Pull request overview
This PR fixes a bug where RMSE (Root Mean Squared Error) metrics in the more_loss dictionary were incorrectly storing MSE (Mean Squared Error) values. The fix adds xp.sqrt() to convert the L2 loss values to proper RMSE values.
- Wraps all
l2_*_lossvariables withxp.sqrt()when assigning tormse_*keys inmore_loss - Ensures consistency with the existing
more_loss["rmse"]calculation at line 268 - Applies the fix uniformly across all six RMSE metrics: energy, force, virial, atom energy, prefactor force, and generalized force
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
📝 WalkthroughWalkthroughModified Changes
Estimated code review effort🎯 2 (Simple) | ⏱️ ~10 minutes
Pre-merge checks and finishing touches✅ Passed checks (3 passed)
✨ Finishing touches
🧪 Generate unit tests (beta)
📜 Recent review detailsConfiguration used: CodeRabbit 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:
🧬 Code graph analysis (1)deepmd/dpmodel/loss/ener.py (3)
⏰ 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). (29)
🔇 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❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## devel #5105 +/- ##
==========================================
- Coverage 82.14% 82.14% -0.01%
==========================================
Files 709 709
Lines 72453 72454 +1
Branches 3616 3615 -1
==========================================
Hits 59515 59515
- Misses 11775 11776 +1
Partials 1163 1163 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
The previous value was MSE. <!-- This is an auto-generated comment: release notes by coderabbit.ai --> ## Summary by CodeRabbit * **Bug Fixes** * Fixed RMSE metric calculations to correctly display square-root values for energy, force, virial, and atom-related loss measurements, ensuring accurate performance metrics reporting. <sub>✏️ Tip: You can customize this high-level summary in your review settings.</sub> <!-- end of auto-generated comment: release notes by coderabbit.ai -->
The previous value was MSE.
Summary by CodeRabbit
✏️ Tip: You can customize this high-level summary in your review settings.