deepmodeling / deepmodeling/dpgen
Refactor use_ele_temp into generic fparam/aparam input handling
- Dominant language
- Python
- Stars
- 399
- Forks
- 198
- Avg merge
- 16d 12h
- Merged PRs (30d)
- 41
Description
## Motivation
DP-GEN currently exposes `use_ele_temp` as a top-level switch for a VASP-specific workflow. The option reads `ele_temp` from VASP post-processing output, writes it into DeepMD `fparam` or `aparam`, and changes the corresponding `numb_fparam` / `numb_aparam` model dimensions.
This is useful for backward compatibility, but it couples the generic DP-GEN workflow to one physical quantity and one FP backend. Electron temperature is not fundamentally different from other frame-level or atom-level conditioning variables.
## Current behavior
- `use_ele_temp=1` stores electron temperature as a frame parameter (`fparam`).
- `use_ele_temp=2` stores the same value as an atom parameter (`aparam`) for every atom.
- The VASP FP/post-processing path performs the extraction and writes the data.
- Training input generation separately modifies fitting-network dimensions.
- The legacy path originally assumed a single top-level `model.fitting_net`; model dictionaries require the same operation for every model branch.
Historical support was introduced by the electron-temperature and atom-parameter changes, and remains part of the public DP-GEN input schema.
## Proposed direction
Refactor the interface around generic parameter data rather than the `ele_temp` concept:
1. Define a generic DP-GEN configuration for frame-level and atom-level parameters, including their dimensions and source names.
2. Let each FP backend map its native output fields into standard DeepMD `fparam` / `aparam` data.
3. Let training-input generation consume the declared dimensions without knowing the physical meaning of the fields.
4. Keep `use_ele_temp` as a deprecated compatibility alias during a migration period.
5. Ensure model-deviation and LAMMPS paths forward the declared parameters consistently for all committee members and model branches.
## Scope and compatibility
- Preserve existing `use_ele_temp` configurations during the transition.
- Cover TensorFlow, PyTorch, and other supported backends consistently.
- Support both ordinary models and `model_dict` branches.
- Add migration documentation and tests for VASP electron temperature plus at least one generic frame/atom parameter example.
- Keep this refactor separate from cross-architecture committee support in #1968.
Contributor guide
No contributing guide indexed for this repository
Research direction
Trace the VASP FP/post-processing path, training-input generation, and model-deviation and LAMMPS paths to locate where use_ele_temp is extracted, stored, and forwarded. Compare TensorFlow and PyTorch handling, including model_dict branches. Done means generic frame- and atom-level parameters work alongside the deprecated alias, with migration documentation and tests for VASP electron temperature and a generic example.
Written by the indexing model from the issue text.
Assessment
- Tech stack
- python, pytorch, tensorflow
- Domain
- machine-learning
- Issue type
- Refactor
- Difficulty
- 5/5
- Estimated time
- Over a week
- Activity status
- Active
- Clarity
- Mostly clear
- Newbie friendliness
- 35/100