deepmd_utils package
Untilization methods for DeePMD-kit.
The __init__ module should not import any modules for performance.
Subpackages
- deepmd_utils.entrypoints package
- deepmd_utils.loggers package
- deepmd_utils.model_format package
DescrptSeA
EmbeddingNet
EnvMat
FittingNet
FittingOutputDef
ModelOutputDef
NativeLayer
NativeNet
NativeOP
NetworkCollection
OutputVariableDef
fitting_check_output()
get_deriv_name()
get_reduce_name()
load_dp_model()
make_embedding_network()
make_fitting_network()
make_multilayer_network()
model_check_output()
save_dp_model()
traverse_model_dict()
- Submodules
- deepmd_utils.model_format.common module
- deepmd_utils.model_format.env_mat module
- deepmd_utils.model_format.network module
- deepmd_utils.model_format.output_def module
- deepmd_utils.model_format.se_e2_a module
- deepmd_utils.utils package
- Submodules
- deepmd_utils.utils.argcheck module
ArgsPlugin
descrpt_hybrid_args()
descrpt_local_frame_args()
descrpt_se_a_args()
descrpt_se_a_ebd_v2_args()
descrpt_se_a_mask_args()
descrpt_se_a_tpe_args()
descrpt_se_atten_args()
descrpt_se_atten_common_args()
descrpt_se_atten_v2_args()
descrpt_se_r_args()
descrpt_se_t_args()
descrpt_variant_type_args()
fitting_dipole()
fitting_dos()
fitting_ener()
fitting_polar()
fitting_variant_type_args()
frozen_model_args()
gen_args()
gen_doc()
gen_json()
learning_rate_args()
learning_rate_dict_args()
learning_rate_exp()
learning_rate_variant_type_args()
limit_pref()
linear_ener_model_args()
list_to_doc()
loss_args()
loss_dict_args()
loss_dos()
loss_ener()
loss_ener_spin()
loss_tensor()
loss_variant_type_args()
make_index()
make_link()
mixed_precision_args()
model_args()
model_compression()
model_compression_type_args()
modifier_dipole_charge()
modifier_variant_type_args()
multi_model_args()
normalize()
normalize_data_dict()
normalize_fitting_net_dict()
normalize_fitting_weight()
normalize_learning_rate_dict()
normalize_learning_rate_dict_with_single_learning_rate()
normalize_loss_dict()
normalize_multi_task()
pairtab_model_args()
pairwise_dprc()
spin_args()
standard_model_args()
start_pref()
training_args()
training_data_args()
type_embedding_args()
validation_data_args()
- deepmd_utils.utils.argcheck_nvnmd module
- deepmd_utils.utils.batch_size module
- deepmd_utils.utils.compat module
- deepmd_utils.utils.data module
DeepmdData
DeepmdData.add()
DeepmdData.avg()
DeepmdData.check_batch_size()
DeepmdData.check_test_size()
DeepmdData.get_atom_type()
DeepmdData.get_batch()
DeepmdData.get_data_dict()
DeepmdData.get_natoms()
DeepmdData.get_natoms_vec()
DeepmdData.get_ntypes()
DeepmdData.get_numb_batch()
DeepmdData.get_numb_set()
DeepmdData.get_sys_numb_batch()
DeepmdData.get_test()
DeepmdData.get_type_map()
DeepmdData.reduce()
DeepmdData.reset_get_batch()
- deepmd_utils.utils.data_system module
DeepmdDataSystem
DeepmdDataSystem.add()
DeepmdDataSystem.add_dict()
DeepmdDataSystem.compute_energy_shift()
DeepmdDataSystem.default_mesh
DeepmdDataSystem.get_batch()
DeepmdDataSystem.get_batch_mixed()
DeepmdDataSystem.get_batch_size()
DeepmdDataSystem.get_batch_standard()
DeepmdDataSystem.get_data_dict()
DeepmdDataSystem.get_nbatches()
DeepmdDataSystem.get_nsystems()
DeepmdDataSystem.get_ntypes()
DeepmdDataSystem.get_sys()
DeepmdDataSystem.get_sys_ntest()
DeepmdDataSystem.get_test()
DeepmdDataSystem.get_type_map()
DeepmdDataSystem.print_summary()
DeepmdDataSystem.reduce()
DeepmdDataSystem.set_sys_probs()
prob_sys_size_ext()
process_sys_probs()
- deepmd_utils.utils.errors module
- deepmd_utils.utils.model_stat module
- deepmd_utils.utils.pair_tab module
- deepmd_utils.utils.path module
- deepmd_utils.utils.plugin module
- deepmd_utils.utils.random module
- deepmd_utils.utils.weight_avg module
Submodules
deepmd_utils.common module
- deepmd_utils.common.add_data_requirement(key: str, ndof: int, atomic: bool = False, must: bool = False, high_prec: bool = False, type_sel: Optional[bool] = None, repeat: int = 1, default: float = 0.0, dtype: Optional[dtype] = None)[source]
Specify data requirements for training.
- Parameters
- key
str
type of data stored in corresponding *.npy file e.g. forces or energy
- ndof
int
number of the degrees of freedom, this is tied to atomic parameter e.g. forces have atomic=True and ndof=3
- atomicbool,
optional
specifies whwther the ndof keyworrd applies to per atom quantity or not, by default False
- mustbool,
optional
specifi if the *.npy data file must exist, by default False
- high_precbool,
optional
if true load data to np.float64 else np.float32, by default False
- type_selbool,
optional
select only certain type of atoms, by default None
- repeat
int
,optional
if specify repaeat data repeat times, by default 1
- default
float
,optional
, default=0. default value of data
- dtype
np.dtype
,optional
the dtype of data, overwrites high_prec if provided
- key
- deepmd_utils.common.expand_sys_str(root_dir: Union[str, Path]) List[str] [source]
Recursively iterate over directories taking those that contain type.raw file.
- deepmd_utils.common.get_np_precision(precision: _PRECISION) dtype [source]
Get numpy precision constant from string.
- Parameters
- precision
_PRECISION
string name of numpy constant or default
- precision
- Returns
np.dtype
numpy presicion constant
- Raises
RuntimeError
if string is invalid
- deepmd_utils.common.j_loader(filename: Union[str, Path]) Dict[str, Any] [source]
Load yaml or json settings file.
- deepmd_utils.common.j_must_have(jdata: Dict[str, _DICT_VAL], key: str, deprecated_key: List[str] = []) _DICT_VAL [source]
Assert that supplied dictionary conaines specified key.
- Returns
_DICT_VAL
value that was store unde supplied key
- Raises
RuntimeError
if the key is not present
- deepmd_utils.common.make_default_mesh(pbc: bool, mixed_type: bool) ndarray [source]
Make mesh.
Only the size of mesh matters, not the values: * 6 for PBC, no mixed types * 0 for no PBC, no mixed types * 7 for PBC, mixed types * 1 for no PBC, mixed types
- Parameters
- Returns
np.ndarray
mesh
- deepmd_utils.common.select_idx_map(atom_types: ndarray, select_types: ndarray) ndarray [source]
Build map of indices for element supplied element types from all atoms list.
- Parameters
- atom_types
np.ndarray
array specifing type for each atoms as integer
- select_types
np.ndarray
types of atoms you want to find indices for
- atom_types
- Returns
np.ndarray
indices of types of atoms defined by select_types in atom_types array
Warning
select_types array will be sorted before finding indices in atom_types
deepmd_utils.env module
- deepmd_utils.env.GLOBAL_ENER_FLOAT_PRECISION
alias of
float64
- deepmd_utils.env.GLOBAL_NP_FLOAT_PRECISION
alias of
float64
deepmd_utils.main module
The entry points for DeePMD-kit.
If only printing the help message, this module does not call the main DeePMD-kit module to avoid the slow import of TensorFlow.
- class deepmd_utils.main.RawTextArgumentDefaultsHelpFormatter(prog, indent_increment=2, max_help_position=24, width=None)[source]
Bases:
RawTextHelpFormatter
,ArgumentDefaultsHelpFormatter
This formatter is used to print multile-line help message with default value.
Methods
format_help
()start_section
(heading)add_argument
add_arguments
add_text
add_usage
end_section
- deepmd_utils.main.main()[source]
DeePMD-kit new entry point.
- Raises
RuntimeError
if no command was input
- deepmd_utils.main.main_parser() ArgumentParser [source]
DeePMD-Kit commandline options argument parser.
- Returns
argparse.ArgumentParser
main parser of DeePMD-kit