deepmd.dpmodel.infer package
Submodules
deepmd.dpmodel.infer.deep_eval module
- class deepmd.dpmodel.infer.deep_eval.DeepEval(model_file: str, *args, **kwargs)[source]
Bases:
DeepEvalBackendNumPy backend implementaion of DeepEval.
- Parameters
- model_file
Path The name of the frozen model file.
- output_def
ModelOutputDef The output definition of the model.
- *args
list Positional arguments.
- auto_batch_sizebool or
intorAutomaticBatchSize, default:False If True, automatic batch size will be used. If int, it will be used as the initial batch size.
- neighbor_list
ase.neighborlist.NewPrimitiveNeighborList,optional The ASE neighbor list class to produce the neighbor list. If None, the neighbor list will be built natively in the model.
- **kwargs
dict Keyword arguments.
- model_file
- Attributes
model_typeThe the evaluator of the model type.
Methods
eval(coords, cells, atom_types[, atomic, ...])Evaluate the energy, force and virial by using this DP.
eval_descriptor(coords, cells, atom_types[, ...])Evaluate descriptors by using this DP.
eval_typeebd()Evaluate output of type embedding network by using this model.
Get the number (dimension) of atomic parameters of this DP.
Get the number (dimension) of frame parameters of this DP.
Check if the model has efield.
Get the number of atom types of this model.
Get the number of spin atom types of this model.
Get the number of DOS.
get_rcut()Get the cutoff radius of this model.
Get the selected atom types of this model.
Get the type map (element name of the atom types) of this model.
- eval(coords: ndarray, cells: ndarray, atom_types: ndarray, atomic: bool = False, fparam: Optional[ndarray] = None, aparam: Optional[ndarray] = None, **kwargs: Dict[str, Any]) Dict[str, ndarray][source]
Evaluate the energy, force and virial by using this DP.
- Parameters
- coords
The coordinates of atoms. The array should be of size nframes x natoms x 3
- cells
The cell of the region. If None then non-PBC is assumed, otherwise using PBC. The array should be of size nframes x 9
- atom_types
The atom types The list should contain natoms ints
- atomic
Calculate the atomic energy and virial
- fparam
The frame parameter. The array can be of size : - nframes x dim_fparam. - dim_fparam. Then all frames are assumed to be provided with the same fparam.
- aparam
The atomic parameter The array can be of size : - nframes x natoms x dim_aparam. - natoms x dim_aparam. Then all frames are assumed to be provided with the same aparam. - dim_aparam. Then all frames and atoms are provided with the same aparam.
- **kwargs
Other parameters
- Returns
- output_dict
dict The output of the evaluation. The keys are the names of the output variables, and the values are the corresponding output arrays.
- output_dict