deepmd.pt.model.atomic_model.dp_atomic_model

Module Contents

Classes

DPAtomicModel

Model give atomic prediction of some physical property.

Attributes

log

deepmd.pt.model.atomic_model.dp_atomic_model.log[source]
class deepmd.pt.model.atomic_model.dp_atomic_model.DPAtomicModel(descriptor, fitting, type_map: List[str], **kwargs)[source]

Bases: deepmd.pt.model.atomic_model.base_atomic_model.BaseAtomicModel

Model give atomic prediction of some physical property.

Parameters:
descriptor

Descriptor

fitting_net

Fitting net

type_map

Mapping atom type to the name (str) of the type. For example type_map[1] gives the name of the type 1.

fitting_output_def() deepmd.dpmodel.FittingOutputDef[source]

Get the output def of the fitting net.

get_rcut() float[source]

Get the cut-off radius.

get_sel() List[int][source]

Get the neighbor selection.

mixed_types() bool[source]

If true, the model 1. assumes total number of atoms aligned across frames; 2. uses a neighbor list that does not distinguish different atomic types.

If false, the model 1. assumes total number of atoms of each atom type aligned across frames; 2. uses a neighbor list that distinguishes different atomic types.

serialize() dict[source]
classmethod deserialize(data) DPAtomicModel[source]
forward_atomic(extended_coord, extended_atype, nlist, mapping: torch.Tensor | None = None, fparam: torch.Tensor | None = None, aparam: torch.Tensor | None = None, comm_dict: Dict[str, torch.Tensor] | None = None) Dict[str, torch.Tensor][source]

Return atomic prediction.

Parameters:
extended_coord

coodinates in extended region

extended_atype

atomic type in extended region

nlist

neighbor list. nf x nloc x nsel

mapping

mapps the extended indices to local indices

fparam

frame parameter. nf x ndf

aparam

atomic parameter. nf x nloc x nda

Returns:
result_dict

the result dict, defined by the FittingOutputDef.

get_out_bias() torch.Tensor[source]
compute_or_load_stat(sampled_func, stat_file_path: deepmd.utils.path.DPPath | None = None)[source]

Compute or load the statistics parameters of the model, such as mean and standard deviation of descriptors or the energy bias of the fitting net. When sampled is provided, all the statistics parameters will be calculated (or re-calculated for update), and saved in the stat_file_path`(s). When `sampled is not provided, it will check the existence of `stat_file_path`(s) and load the calculated statistics parameters.

Parameters:
sampled_func

The lazy sampled function to get data frames from different data systems.

stat_file_path

The dictionary of paths to the statistics files.

get_dim_fparam() int[source]

Get the number (dimension) of frame parameters of this atomic model.

get_dim_aparam() int[source]

Get the number (dimension) of atomic parameters of this atomic model.

get_sel_type() List[int][source]

Get the selected atom types of this model.

Only atoms with selected atom types have atomic contribution to the result of the model. If returning an empty list, all atom types are selected.

is_aparam_nall() bool[source]

Check whether the shape of atomic parameters is (nframes, nall, ndim).

If False, the shape is (nframes, nloc, ndim).