deepmd.pt_expt.entrypoints.main#
Training entrypoint for the pt_expt backend.
Attributes#
Functions#
| Return the LMDB path when |
| Return a data proxy suitable for |
| Build a data system from dataset config, routing LMDB paths to LmdbDataSystem. |
| Build a |
| Run training with the pt_expt backend. |
| Freeze a pt_expt checkpoint into a .pte exported model. |
| Change the output bias of a pt_expt model. |
| Entry point for the pt_expt backend CLI. |
Module Contents#
- deepmd.pt_expt.entrypoints.main._detect_lmdb_path(systems_raw: Any) str | None[source]#
Return the LMDB path when
systems_rawis a scalar LMDB string.Returns
Nonefor non-LMDB inputs. RaisesValueErrorifsystems_rawis a list containing any LMDB path, so both_get_neighbor_stat_dataand_build_data_systemfail with the same clear message instead of the opaque error fromprocess_systems()/DeepmdData.
- deepmd.pt_expt.entrypoints.main._get_neighbor_stat_data(dataset_params: dict[str, Any], type_map: list[str] | None) Any[source]#
Return a data proxy suitable for
BaseModel.update_sel(neighbor stat).Routes a scalar LMDB
systemspath through dpmodel’smake_neighbor_stat_data; falls back to the legacyget_datafor npy/HDF5 directories.
- deepmd.pt_expt.entrypoints.main._build_data_system(dataset_params: dict[str, Any], type_map: list[str], seed: int | None = None) deepmd.utils.data_system.DeepmdDataSystem | deepmd.pt_expt.utils.lmdb_dataset.LmdbDataSystem[source]#
Build a data system from dataset config, routing LMDB paths to LmdbDataSystem.
A scalar
systemsvalue pointing at an LMDB directory triggers the LMDB adapter; otherwise we fall through to the legacyDeepmdDataSystempath with system expansion.
- deepmd.pt_expt.entrypoints.main.get_trainer(config: dict[str, Any], init_model: str | None = None, restart_model: str | None = None, finetune_model: str | None = None, finetune_links: dict | None = None, shared_links: dict | None = None) deepmd.pt_expt.train.training.Trainer[source]#
Build a
training.Trainerfrom a normalised config.
- deepmd.pt_expt.entrypoints.main.train(input_file: str, init_model: str | None = None, restart: str | None = None, finetune: str | None = None, model_branch: str = '', use_pretrain_script: bool = False, skip_neighbor_stat: bool = False, output: str = 'out.json') None[source]#
Run training with the pt_expt backend.
- Parameters:
- input_file
str Path to the JSON configuration file.
- init_model
strorNone Path to a checkpoint to initialise weights from.
- restart
strorNone Path to a checkpoint to restart training from.
- finetune
strorNone Path to a pretrained checkpoint to fine-tune from.
- model_branch
str Branch to select from a multi-task pretrained model.
- use_pretrain_scriptbool
If True, copy descriptor/fitting params from the pretrained model.
- skip_neighbor_statbool
Skip neighbour statistics calculation.
- output
str Where to dump the normalised config.
- input_file
- deepmd.pt_expt.entrypoints.main.freeze(model: str, output: str = 'frozen_model.pte', head: str | None = None) None[source]#
Freeze a pt_expt checkpoint into a .pte exported model.
- deepmd.pt_expt.entrypoints.main.change_bias(input_file: str, mode: str = 'change', bias_value: list | None = None, datafile: str | None = None, system: str = '.', numb_batch: int = 0, model_branch: str | None = None, output: str | None = None) None[source]#
Change the output bias of a pt_expt model.
- Parameters:
- input_file
str Path to the model file (.pt checkpoint or .pte frozen model).
- mode
str "change"or"set".- bias_value
listorNone User-defined bias values (one per type).
- datafile
strorNone File listing data system paths.
- system
str Data system path (used when datafile is None).
- numb_batch
int Number of batches for statistics (0 = all).
- model_branch
strorNone Branch name for multi-task models.
- output
strorNone Output file path.
- input_file