deepmd.dpmodel
Subpackages
deepmd.dpmodel.atomic_model
deepmd.dpmodel.descriptor
deepmd.dpmodel.fitting
deepmd.dpmodel.fitting.base_fitting
deepmd.dpmodel.fitting.dipole_fitting
deepmd.dpmodel.fitting.dos_fitting
deepmd.dpmodel.fitting.ener_fitting
deepmd.dpmodel.fitting.general_fitting
deepmd.dpmodel.fitting.invar_fitting
deepmd.dpmodel.fitting.make_base_fitting
deepmd.dpmodel.fitting.polarizability_fitting
deepmd.dpmodel.infer
deepmd.dpmodel.model
deepmd.dpmodel.utils
deepmd.dpmodel.utils.batch_size
deepmd.dpmodel.utils.env_mat
deepmd.dpmodel.utils.exclude_mask
deepmd.dpmodel.utils.neighbor_stat
deepmd.dpmodel.utils.network
deepmd.dpmodel.utils.nlist
deepmd.dpmodel.utils.region
deepmd.dpmodel.utils.serialization
deepmd.dpmodel.utils.type_embed
deepmd.dpmodel.utils.update_sel
Submodules
Package Contents
Classes
The unit operation of a native model. | |
Defines the shapes and other properties of the fitting network outputs. | |
Defines the shapes and other properties of the model outputs. | |
Defines the shape and other properties of the one output variable. |
Functions
| Check if the output of the Fitting is consistent with the definition. |
| |
| |
| |
| Check if the output of the Model is consistent with the definition. |
Attributes
- class deepmd.dpmodel.FittingOutputDef(var_defs: List[OutputVariableDef])[source]
Defines the shapes and other properties of the fitting network outputs.
It is assume that the fitting network output variables for each local atom. This class defines all the outputs.
- Parameters:
- var_defs
List of output variable definitions.
- __getitem__(key: str) OutputVariableDef [source]
- get_data() Dict[str, OutputVariableDef] [source]
- class deepmd.dpmodel.ModelOutputDef(fit_defs: FittingOutputDef)[source]
Defines the shapes and other properties of the model outputs.
The model reduce and differentiate fitting outputs if applicable. If a variable is named by foo, then the reduced variable is called foo_redu, the derivative w.r.t. coordinates is called foo_derv_r and the derivative w.r.t. cell is called foo_derv_c.
- Parameters:
- fit_defs
Definition for the fitting net output
- __getitem__(key: str) OutputVariableDef [source]
- get_data(key: str) Dict[str, OutputVariableDef] [source]
- class deepmd.dpmodel.OutputVariableDef(name: str, shape: List[int], reduciable: bool = False, r_differentiable: bool = False, c_differentiable: bool = False, atomic: bool = True, category: int = OutputVariableCategory.OUT.value, r_hessian: bool = False, magnetic: bool = False)[source]
Defines the shape and other properties of the one output variable.
It is assume that the fitting network output variables for each local atom. This class defines one output variable, including its name, shape, reducibility and differentiability.
- Parameters:
- name
Name of the output variable. Notice that the xxxx_redu, xxxx_derv_c, xxxx_derv_r are reserved names that should not be used to define variables.
- shape
The shape of the variable. e.g. energy should be [1], dipole should be [3], polarizabilty should be [3,3].
- reduciable
If the variable is reduced.
- r_differentiable
If the variable is differentiated with respect to coordinates of atoms. Only reduciable variable are differentiable. Negative derivative w.r.t. coordinates will be calcualted. (e.g. force)
- c_differentiable
If the variable is differentiated with respect to the cell tensor (pbc case). Only reduciable variable are differentiable. Virial, the transposed negative gradient with cell tensor times cell tensor, will be calculated, see eq 40 JCP 159, 054801 (2023).
- atomicbool
If the variable is defined for each atom.
- category
int
The category of the output variable.
- r_hessianbool
If hessian is requred
- magneticbool
If the derivatives of variable have magnetic parts.
- property size