You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
feat(property): Support element type-wise bias in property fitting (#5322)
### Summary
Introduced the `distinguish_types` option for property fitting to
support more flexible atom contribution calculations.
- `distinguish_types=True`(Default) has consistent behavior with energy
fitting(if the property is extensive), calculating individual atom
contributions based on each specific atom type.
- `distinguish_types=False` treats atom contributions as
element-agnostic. This is particularly useful for element extrapolation
scenarios where the model needs to generalize across different chemical
species.
### Key changes
- `deepmd/pt/model/task/property.py`:
- Add `distinguish_types` parameter.
- Change the serialization version from 5 to 6.
- `deepmd/pt/utils/stat.py`:
- Refactored `output_std`: Replaced from the constant "ones" padding
with actual standard deviation values(required by function
`apply_out_stat` in
`deepmd/pt/model/atomic_model/property_atomic_model.py`)
- Optimized the RMSE logging/printing logic for better clarity.
- `deepmd/utils/out_stat.py`:
- Updated `compute_stats_from_redu` to include the `intensive`
parameter.
<!-- This is an auto-generated comment: release notes by coderabbit.ai
-->
## Summary by CodeRabbit
* **New Features**
* Added a distinguish_types option for property fitting and an intensive
mode for statistics computation.
* **Bug Fixes**
* Output statistics can be applied per atom type when enabled; global
standard deviations are now correctly broadcast to per-type shapes.
* Normalization and RMSE reporting adjusted to handle intensive vs
per-atom modes.
* **Tests**
* Added/updated tests covering intensive statistics and updated expected
statistic values.
<!-- end of auto-generated comment: release notes by coderabbit.ai -->
---------
Co-authored-by: pre-commit-ci[bot] <66853113+pre-commit-ci[bot]@users.noreply.github.com>
0 commit comments