fix(pt): Huber energy loss uses raw model energy#5168
fix(pt): Huber energy loss uses raw model energy#5168iProzd merged 5 commits intodeepmodeling:masterfrom
Conversation
…hat includes atom_ener_coeff weighting, so coefficients are silently dropped when use_huber=True
📝 WalkthroughWalkthroughHuber branch in energy loss now calls custom_huber_loss with precomputed energy_pred and energy_label tensors instead of model_pred["energy"]/label["energy"]. Tests updated to add enable_atom_ener_coeff flag and related test data fields; minor array-shape/axis clarifications applied in dpmodel loss code. Changes
Sequence Diagram(s)(omitted) Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 1 | ❌ 2❌ Failed checks (2 warnings)
✅ Passed checks (1 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing touches
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 #5168 +/- ##
=======================================
Coverage 81.93% 81.94%
=======================================
Files 714 714
Lines 73397 73412 +15
Branches 3616 3616
=======================================
+ Hits 60140 60155 +15
+ Misses 12094 12092 -2
- Partials 1163 1165 +2 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
iProzd
left a comment
There was a problem hiding this comment.
xp.shape(atom_ener) should be atom_ener.shape in https://github.com/deepmodeling/deepmd-kit/blob/master/deepmd/dpmodel/loss/ener.py#L134 .
It seems that ut never reached here. @njzjz
You are correct. |
Huber energy loss uses raw model energy instead of
energy_predthat includesatom_ener_coeffweighting, so coefficients are silently dropped when use_huber=TrueSummary by CodeRabbit
Bug Fixes
Tests
✏️ Tip: You can customize this high-level summary in your review settings.