feat(loss): support three-value huber delta#5329
feat(loss): support three-value huber delta#5329OutisLi wants to merge 2 commits intodeepmodeling:masterfrom
Conversation
|
No actionable comments were generated in the recent review. 🎉 ℹ️ Recent review info⚙️ Run configurationConfiguration used: Repository UI Review profile: CHILL Plan: Pro Run ID: 📒 Files selected for processing (6)
🚧 Files skipped from review as they are similar to previous changes (3)
📝 WalkthroughWalkthroughEnergy-loss modules now accept either a single float or a 3-element list for Changes
Estimated code review effort🎯 3 (Moderate) | ⏱️ ~20 minutes Possibly related PRs
Suggested reviewers
🚥 Pre-merge checks | ✅ 2 | ❌ 1❌ Failed checks (1 warning)
✅ Passed checks (2 passed)
✏️ Tip: You can configure your own custom pre-merge checks in the settings. ✨ Finishing Touches🧪 Generate unit tests (beta)
📝 Coding Plan
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 |
There was a problem hiding this comment.
Pull request overview
Adds support for specifying separate Huber-loss deltas for energy/force/virial in the PyTorch and dpmodel energy losses, and updates the config arg schema/docs to allow either a scalar or 3-value list.
Changes:
- Extend
huber_deltato acceptfloat | list[float]and resolve it into per-term deltas in PyTorch and dpmodel energy losses. - Update argcheck documentation and schema type for
huber_deltato allow a 3-value list[energy, force, virial].
Reviewed changes
Copilot reviewed 3 out of 3 changed files in this pull request and generated 5 comments.
| File | Description |
|---|---|
deepmd/utils/argcheck.py |
Updates huber_delta documentation and schema type to allow either a float or 3-value list. |
deepmd/pt/loss/ener.py |
Resolves huber_delta into per-term deltas and applies them in Huber loss branches. |
deepmd/dpmodel/loss/ener.py |
Mirrors the per-term delta resolution and usage for the array-API/dpmodel implementation. |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Codecov Report❌ Patch coverage is
Additional details and impacted files@@ Coverage Diff @@
## master #5329 +/- ##
=======================================
Coverage 82.30% 82.30%
=======================================
Files 777 778 +1
Lines 77938 77953 +15
Branches 3675 3676 +1
=======================================
+ Hits 64150 64163 +13
- Misses 12614 12617 +3
+ Partials 1174 1173 -1 ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
Allow huber_delta to accept either one shared float or a three-value list for energy, force and virial.
for more information, see https://pre-commit.ci
Allow huber_delta to accept either one shared float or a three-value list for energy, force and virial.
Summary by CodeRabbit
New Features
Documentation