deepmd.entrypoints package
Submodule that contains all the DeePMD-Kit entry point scripts.
- deepmd.entrypoints.compress(*, input: str, output: str, extrapolate: int, step: float, frequency: str, checkpoint_folder: str, training_script: str, mpi_log: str, log_path: str | None, log_level: int, **kwargs)[source]
Compress model.
The table is composed of fifth-order polynomial coefficients and is assembled from two sub-tables. The first table takes the step parameter as the domain’s uniform step size, while the second table takes 10 * step as it’s uniform step size. The range of the first table is automatically detected by the code, while the second table ranges from the first table’s upper boundary(upper) to the extrapolate(parameter) * upper.
- Parameters:
- input
str frozen model file to compress
- output
str compressed model filename
- extrapolate
int scale of model extrapolation
- step
float uniform step size of the tabulation’s first table
- frequency
str frequency of tabulation overflow check
- checkpoint_folder
str trining checkpoint folder for freezing
- training_script
str training script of the input frozen model
- mpi_log
str mpi logging mode for training
- log_path
Optional[str] if speccified log will be written to this file
- log_level
int logging level
- **kwargs
additional arguments
- input
- deepmd.entrypoints.config(*, output: str, **kwargs)[source]
Auto config file generator.
- Parameters:
- output
str file to write config file
- **kwargs
additional arguments
- output
- Raises:
RuntimeErrorif user does not input any systems
ValueErrorif output file is of wrong type
- **kwargs
additional arguments
- deepmd.entrypoints.doc_train_input(*, out_type: str = 'rst', **kwargs)[source]
Print out trining input arguments to console.
- deepmd.entrypoints.freeze(*, checkpoint_folder: str, output: str, node_names: str | None = None, nvnmd_weight: str | None = None, united_model: bool = False, **kwargs)[source]
Freeze the graph in supplied folder.
- Parameters:
- checkpoint_folder
str location of the folder with model
- output
str output file name
- node_names
Optional[str],optional names of nodes to output, by default None
- nvnmd_weight
Optional[str],optional nvnmd weight file
- united_modelbool
when in multi-task mode, freeze all nodes into one unit model
- **kwargs
other arguments
- checkpoint_folder
- deepmd.entrypoints.make_model_devi(*, models: list, system: str, set_prefix: str, output: str, frequency: int, **kwargs)[source]
Make model deviation calculation.
- Parameters:
- models
list A list of paths of models to use for making model deviation
- system
str The path of system to make model deviation calculation
- set_prefix
str The set prefix of the system
- output
str The output file for model deviation results
- frequency
int The number of steps that elapse between writing coordinates in a trajectory by a MD engine (such as Gromacs / Lammps). This paramter is used to determine the index in the output file.
- **kwargs
Arbitrary keyword arguments.
- models
- deepmd.entrypoints.neighbor_stat(*, system: str, rcut: float, type_map: List[str], one_type: bool = False, **kwargs)[source]
Calculate neighbor statistics.
- Parameters:
Examples
>>> neighbor_stat(system='.', rcut=6., type_map=["C", "H", "O", "N", "P", "S", "Mg", "Na", "HW", "OW", "mNa", "mCl", "mC", "mH", "mMg", "mN", "mO", "mP"]) min_nbor_dist: 0.6599510670195264 max_nbor_size: [23, 26, 19, 16, 2, 2, 1, 1, 72, 37, 5, 0, 31, 29, 1, 21, 20, 5]
- deepmd.entrypoints.test(*, model: str, system: str, datafile: str, set_prefix: str, numb_test: int, rand_seed: int | None, shuffle_test: bool, detail_file: str, atomic: bool, **kwargs)[source]
Test model predictions.
- Parameters:
- model
str path where model is stored
- system
str system directory
- datafile
str the path to the list of systems to test
- set_prefix
str string prefix of set
- numb_test
int munber of tests to do
- rand_seed
Optional[int] seed for random generator
- shuffle_testbool
whether to shuffle tests
- detail_file
Optional[str] file where test details will be output
- atomicbool
whether per atom quantities should be computed
- **kwargs
additional arguments
- model
- Raises:
RuntimeErrorif no valid system was found
- deepmd.entrypoints.train_dp(*, INPUT: str, init_model: str | None, restart: str | None, output: str, init_frz_model: str, mpi_log: str, log_level: int, log_path: str | None, is_compress: bool = False, skip_neighbor_stat: bool = False, finetune: str | None = None, **kwargs)
Run DeePMD model training.
- Parameters:
- INPUT
str json/yaml control file
- init_model
Optional[str] path to checkpoint folder or None
- restart
Optional[str] path to checkpoint folder or None
- output
str path for dump file with arguments
- init_frz_model
str path to frozen model or None
- mpi_log
str mpi logging mode
- log_level
int logging level defined by int 0-3
- log_path
Optional[str] logging file path or None if logs are to be output only to stdout
- is_compressbool
indicates whether in the model compress mode
- skip_neighbor_statbool, default=False
skip checking neighbor statistics
- finetune
Optional[str] path to pretrained model or None
- **kwargs
additional arguments
- INPUT
- Raises:
RuntimeErrorif distributed training job name is wrong
- deepmd.entrypoints.transfer(*, old_model: str, raw_model: str, output: str, **kwargs)[source]
Transfer operation from old fron graph to new prepared raw graph.
Submodules
deepmd.entrypoints.compress module
Compress a model, which including tabulating the embedding-net.
- deepmd.entrypoints.compress.compress(*, input: str, output: str, extrapolate: int, step: float, frequency: str, checkpoint_folder: str, training_script: str, mpi_log: str, log_path: str | None, log_level: int, **kwargs)[source]
Compress model.
The table is composed of fifth-order polynomial coefficients and is assembled from two sub-tables. The first table takes the step parameter as the domain’s uniform step size, while the second table takes 10 * step as it’s uniform step size. The range of the first table is automatically detected by the code, while the second table ranges from the first table’s upper boundary(upper) to the extrapolate(parameter) * upper.
- Parameters:
- input
str frozen model file to compress
- output
str compressed model filename
- extrapolate
int scale of model extrapolation
- step
float uniform step size of the tabulation’s first table
- frequency
str frequency of tabulation overflow check
- checkpoint_folder
str trining checkpoint folder for freezing
- training_script
str training script of the input frozen model
- mpi_log
str mpi logging mode for training
- log_path
Optional[str] if speccified log will be written to this file
- log_level
int logging level
- **kwargs
additional arguments
- input
deepmd.entrypoints.config module
Quickly create a configuration file for smooth model.
- deepmd.entrypoints.config.config(*, output: str, **kwargs)[source]
Auto config file generator.
- Parameters:
- output
str file to write config file
- **kwargs
additional arguments
- output
- Raises:
RuntimeErrorif user does not input any systems
ValueErrorif output file is of wrong type
- **kwargs
additional arguments
deepmd.entrypoints.convert module
deepmd.entrypoints.doc module
Module that prints train input arguments docstrings.
deepmd.entrypoints.freeze module
Script for freezing TF trained graph so it can be used with LAMMPS and i-PI.
References
- deepmd.entrypoints.freeze.freeze(*, checkpoint_folder: str, output: str, node_names: str | None = None, nvnmd_weight: str | None = None, united_model: bool = False, **kwargs)[source]
Freeze the graph in supplied folder.
- Parameters:
- checkpoint_folder
str location of the folder with model
- output
str output file name
- node_names
Optional[str],optional names of nodes to output, by default None
- nvnmd_weight
Optional[str],optional nvnmd weight file
- united_modelbool
when in multi-task mode, freeze all nodes into one unit model
- **kwargs
other arguments
- checkpoint_folder
deepmd.entrypoints.ipi module
Use dp_ipi inside the Python package.
deepmd.entrypoints.main module
DeePMD-Kit entry point module.
- deepmd.entrypoints.main.main(args: List[str] | None = None)[source]
DeePMD-Kit entry point.
- Parameters:
- Raises:
RuntimeErrorif no command was input
- deepmd.entrypoints.main.main_parser() ArgumentParser[source]
DeePMD-Kit commandline options argument parser.
- Returns:
argparse.ArgumentParsermain parser of DeePMD-kit
deepmd.entrypoints.neighbor_stat module
- deepmd.entrypoints.neighbor_stat.neighbor_stat(*, system: str, rcut: float, type_map: List[str], one_type: bool = False, **kwargs)[source]
Calculate neighbor statistics.
- Parameters:
Examples
>>> neighbor_stat(system='.', rcut=6., type_map=["C", "H", "O", "N", "P", "S", "Mg", "Na", "HW", "OW", "mNa", "mCl", "mC", "mH", "mMg", "mN", "mO", "mP"]) min_nbor_dist: 0.6599510670195264 max_nbor_size: [23, 26, 19, 16, 2, 2, 1, 1, 72, 37, 5, 0, 31, 29, 1, 21, 20, 5]
deepmd.entrypoints.test module
Test trained DeePMD model.
- deepmd.entrypoints.test.test(*, model: str, system: str, datafile: str, set_prefix: str, numb_test: int, rand_seed: int | None, shuffle_test: bool, detail_file: str, atomic: bool, **kwargs)[source]
Test model predictions.
- Parameters:
- model
str path where model is stored
- system
str system directory
- datafile
str the path to the list of systems to test
- set_prefix
str string prefix of set
- numb_test
int munber of tests to do
- rand_seed
Optional[int] seed for random generator
- shuffle_testbool
whether to shuffle tests
- detail_file
Optional[str] file where test details will be output
- atomicbool
whether per atom quantities should be computed
- **kwargs
additional arguments
- model
- Raises:
RuntimeErrorif no valid system was found
deepmd.entrypoints.train module
DeePMD training entrypoint script.
Can handle local or distributed training.
- deepmd.entrypoints.train.train(*, INPUT: str, init_model: str | None, restart: str | None, output: str, init_frz_model: str, mpi_log: str, log_level: int, log_path: str | None, is_compress: bool = False, skip_neighbor_stat: bool = False, finetune: str | None = None, **kwargs)[source]
Run DeePMD model training.
- Parameters:
- INPUT
str json/yaml control file
- init_model
Optional[str] path to checkpoint folder or None
- restart
Optional[str] path to checkpoint folder or None
- output
str path for dump file with arguments
- init_frz_model
str path to frozen model or None
- mpi_log
str mpi logging mode
- log_level
int logging level defined by int 0-3
- log_path
Optional[str] logging file path or None if logs are to be output only to stdout
- is_compressbool
indicates whether in the model compress mode
- skip_neighbor_statbool, default=False
skip checking neighbor statistics
- finetune
Optional[str] path to pretrained model or None
- **kwargs
additional arguments
- INPUT
- Raises:
RuntimeErrorif distributed training job name is wrong
deepmd.entrypoints.transfer module
Module used for transfering parameters between models.