Skip to content

pt losses dens/population/denoise: not covered by mixed_type padding fix #5761

Description

@wanghan-iapcm

Follow-up to #5738.

PR #5738 applied per-frame, mask-aware loss normalization (excluding type<0 ghost padding atoms in mixed_type batches) to five shared loss types — ener, ener_spin, dos, tensor, property — across the dpmodel and pt backends. The pt-only losses dens, population, and denoise were out of scope and were not audited or fixed.

Scope: audit deepmd/pt/loss/{dens,population,denoise}.py for the same mixed_type padding artifact (denominators / means diluted by ghost atoms), apply the per-frame masked normalization where needed under the existing model_dict["mask"] convention, and add grad-accumulation-invariant + all-ones-mask no-op tests mirroring source/tests/pt/test_loss_padding.py. If a given loss is already frame-decomposable, document that instead.

Activity

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Metadata

Metadata

Assignees

No one assigned

    Labels

    Type

    No type

    Projects

    No projects

      Milestone

      No milestone

      Relationships

      None yet

      Development

      No branches or pull requests

      Issue actions