docs(loss): document loss_func/f_use_norm and three-value huber_delta
Maintainers usually reply within 3 days
Nobody has claimed this yet.
Assessment
- Difficulty
- 3/5
- Estimated time
- 1-2 days
- Newbie friendliness
- 72/100
- Issue type
- Documentation
- Clarity
- Clearly specified
- Activity status
- Quiet
- Tech stack
- python, pytorch, tensorflow
- Domain
- documentation, machine-learning
Research direction
Start with the loss section in doc/model/train-energy.md, then read deepmd/utils/argcheck.py and the loss implementations in deepmd/dpmodel/loss/ener.py and deepmd/pt/loss/ener.py. Document loss_func, f_use_norm, and scalar or three-value huber_delta with verified defaults and backend restrictions, add the requested JSON examples, and confirm grep finds all three keys.
Written by the indexing model from the issue text.
Description
Parent issue: #5917 (checklist items 13–14)
Scope
Two energy-loss options exist only as schema entries:
- Force L2-norm / MAE loss (
3f52fa95a,feat(dp, pt): add force l2 norm loss & mae loss, PR #5294). NOTE: the shipped config keys areloss_func("mse"/"mae") andf_use_norm, notforce_l2_norm— the original checklist item title used a pre-merge name. Schema:deepmd/utils/argcheck.py:4319-4331(doc_loss_func,doc_f_use_norm), arguments at:4468-4479. Semantics:loss_funcselects MSE vs MAE for energy/force/virial/atom losses;f_use_normuses the L2 norm of force vectors in the loss and is only valid whenloss_func="mae"oruse_huber=True(validation enforced). - Three-value Huber delta (
14c349b42):huber_deltaaccepts a single float or a list of three values (schema atargcheck.py:4481-4487,[float, list[float]], default0.01). Verify from the loss implementation which three losses the three values correspond to (likely energy/force/virial — confirm indeepmd/dpmodel/loss/ener.pyanddeepmd/pt/loss/ener.py).
Neither appears in doc/model/train-energy.md; grep huber doc/ returns nothing.
Implementation plan
doc/model/train-energy.md
Read the loss section of the page plus argcheck.py entries and the DP/PT ener loss implementations first. Extend the loss prose (near the use_huber / pref documentation):
loss_func:"mse"(verify default) vs"mae", which loss terms it applies to, backend support (DP & PyTorch per the commit title — verify TF support is absent before claiming);f_use_norm: what it changes for force loss (norm of the force vector instead of per-component), and the validity constraint (loss_func="mae"oruse_huber=True);use_huber+huber_delta: Huber loss threshold; document scalar vs three-value forms and their meaning, with default0.01(verify per-backend support from code);- A minimal JSON example showing
loss_func: "mae"withf_use_norm: true, and one with a three-valuehuber_delta.
Constraints
- Use the shipped key names (
loss_func,f_use_norm); the checklist'sforce_l2_normwas a working title. - Verify defaults and backend support in
argcheck.pyand the loss classes; state backend restrictions explicitly. - Keep math/style consistent with the surrounding loss documentation.
Verification
grep -n "loss_func\|f_use_norm\|huber_delta" doc/model/train-energy.mdshows the new prose.
Parent issue: #5917
Coding agent: opencode
opencode version: 1.18.9
Model: ustc/k3
Reasoning effort: max
- Dominant language
- Python
- Stars
- 2.1k
- Forks
- 663
- Avg merge
- 3d 11h
- Merged PRs (30d)
- 25
Getting set up
Starts the project's dev container in your browser, under your own GitHub account.
- No Dockerfile or Docker Compose file
- No pull request template
- Read the contributing guide
First steps
- Read the whole issue, then the project's contributing guide.
- Comment on the issue to say you are picking it up — it saves two people doing the same work.
- Fork the repository and make your change on a branch.
- Open a pull request that references the issue number.
More from deepmodeling/deepmd-kit
-
Difficulty 2/5 1-3 hours Newbie friendliness 73/100
deepmodeling/deepmd-kit#6086 ·
Maintainers usually reply within 3 days
-
Fine-tune descriptor mismatch warning should ignore seedPossibly taken @SiyuanChenToDo claimed this 23 days ago. Open
Difficulty 1/5 Under an hour Newbie friendliness 88/100
deepmodeling/deepmd-kit#6038 · 2 comments ·
Maintainers usually reply within 3 days
-
Docs enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
deepmodeling/deepmd-kit#5766 · 1 comment ·
Maintainers usually reply within 3 days
-
branch: master lang: py todo comment type: todo
Difficulty 2/5 1-3 hours Newbie friendliness 72/100
deepmodeling/deepmd-kit#5480 ·
Maintainers usually reply within 3 days
-
branch: master lang: toml todo comment type: todo
Difficulty 1/5 Under an hour Newbie friendliness 72/100
deepmodeling/deepmd-kit#5462 ·
Maintainers usually reply within 3 days
All issues in deepmodeling/deepmd-kit
Similar issues
-
documentation good first issue priority: P2 status: ready
Difficulty 1/5 Under an hour Newbie friendliness 88/100
RhinoLink-Tech/data-fabric#500 ·
Maintainers usually reply within 1 day
-
backlog
Difficulty 2/5 1-3 hours Newbie friendliness 78/100
EchoTools/nevr-runtime#2384 ·
Maintainers usually reply within 1 day
-
[Bug]: The H2 series' and the H3C's fan 3 is labelled "Chamber Fan", Bambu calls it the exhaust fanOpenarea:ui
Difficulty 2/5 1-3 hours Newbie friendliness 88/100
Maintainers usually reply within 1 day
-
Difficulty 2/5 1-3 hours Newbie friendliness 68/100
btclib-org/btclib#3062 ·
Maintainers usually reply within 1 day
-
area:evals area:infra enhancement
Difficulty 2/5 1-3 hours Newbie friendliness 74/100
jse-avl/support-bot#4 · 1 comment ·