Context
Follow-up from #5738 and its review thread: #5738 (comment)
#5738 correctly makes the global loss padding-invariant and does not need to expand scope for this display-only refinement. However, for masked mixed_type batches with unequal real atom counts, the reported global rmse_* metrics still compute a batch RMSE and divide it by mean(real_natoms). That is not equivalent to normalizing each frame before aggregating.
For example, with real atom counts [3, 5] and extensive errors [3, 5] (per-atom error 1 in each frame), the current summary is:
sqrt((3² + 5²) / 2) / 4 = 1.0308
while processing either frame alone reports 1.
Scope
For masked paths, define the global display metric as an aggregation of per-frame normalized squared errors, for example:
sqrt(mean(mean(diff**2, axis=-1) / real_natoms**2))
Apply the same semantics consistently to:
- global DOS and CDF
rmse_* displays;
- global
TensorLoss rmse_* displays;
- their PyTorch (
deepmd/pt/loss/) mirrors.
Likely touch points are deepmd/dpmodel/loss/{dos,tensor}.py and deepmd/pt/loss/{dos,tensor}.py.
Acceptance criteria
- The training objective and gradients remain unchanged; this issue concerns diagnostics/display metrics only.
- A mixed-size masked batch reports the same normalized global RMSE as the corresponding per-frame calls, under the chosen aggregation semantics.
- All-ones / non-masked behavior remains unchanged from
master.
- Tests cover an unequal-size batch (e.g.
[3, 5]) for DOS, CDF, and tensor paths in both implementations.
— OpenClaw (model: custom-chat-jinzhezeng-group/gpt-5.6-terra)
Context
Follow-up from #5738 and its review thread: #5738 (comment)
#5738 correctly makes the global loss padding-invariant and does not need to expand scope for this display-only refinement. However, for masked
mixed_typebatches with unequal real atom counts, the reported globalrmse_*metrics still compute a batch RMSE and divide it bymean(real_natoms). That is not equivalent to normalizing each frame before aggregating.For example, with real atom counts
[3, 5]and extensive errors[3, 5](per-atom error 1 in each frame), the current summary is:while processing either frame alone reports
1.Scope
For masked paths, define the global display metric as an aggregation of per-frame normalized squared errors, for example:
Apply the same semantics consistently to:
rmse_*displays;TensorLossrmse_*displays;deepmd/pt/loss/) mirrors.Likely touch points are
deepmd/dpmodel/loss/{dos,tensor}.pyanddeepmd/pt/loss/{dos,tensor}.py.Acceptance criteria
master.[3, 5]) for DOS, CDF, and tensor paths in both implementations.— OpenClaw (model: custom-chat-jinzhezeng-group/gpt-5.6-terra)