deepmd.pt.model.model.frozen

Module Contents

Classes

FrozenModel

Load model from a frozen model, which cannot be trained.

class deepmd.pt.model.model.frozen.FrozenModel(model_file: str, **kwargs)[source]

Bases: deepmd.pt.model.model.model.BaseModel

Load model from a frozen model, which cannot be trained.

Parameters:
model_filestr

The path to the frozen model

fitting_output_def() deepmd.dpmodel.output_def.FittingOutputDef[source]

Get the output def of developer implemented atomic models.

get_rcut() float[source]

Get the cut-off radius.

get_type_map() List[str][source]

Get the type map.

get_sel() List[int][source]

Returns the number of selected atoms for each type.

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).

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.

forward(coord, atype, box: torch.Tensor | None = None, fparam: torch.Tensor | None = None, aparam: torch.Tensor | None = None, do_atomic_virial: bool = False) Dict[str, torch.Tensor][source]
get_model_def_script() str[source]

Get the model definition script.

serialize() dict[source]

Serialize the model.

Returns:
dict

The serialized data

classmethod deserialize(data: dict)[source]

Deserialize the model.

Parameters:
datadict

The serialized data

Returns:
BaseModel

The deserialized model

get_nnei() int[source]

Returns the total number of selected neighboring atoms in the cut-off radius.

get_nsel() int[source]

Returns the total number of selected neighboring atoms in the cut-off radius.

classmethod update_sel(global_jdata: dict, local_jdata: dict)[source]

Update the selection and perform neighbor statistics.

Parameters:
global_jdatadict

The global data, containing the training section

local_jdatadict

The local data refer to the current class

model_output_type() str[source]

Get the output type for the model.