deepmd.tf.model.frozen#
Classes#
Load model from a frozen model, which cannot be trained. |
Module Contents#
- class deepmd.tf.model.frozen.FrozenModel(model_file: str, **kwargs)[source]#
Bases:
deepmd.tf.model.model.Model
Load model from a frozen model, which cannot be trained.
- Parameters:
- model_file
str
The path to the frozen model
- model_file
- build(coord_: deepmd.tf.env.tf.Tensor, atype_: deepmd.tf.env.tf.Tensor, natoms: deepmd.tf.env.tf.Tensor, box: deepmd.tf.env.tf.Tensor, mesh: deepmd.tf.env.tf.Tensor, input_dict: dict, frz_model: str | None = None, ckpt_meta: str | None = None, suffix: str = '', reuse: bool | enum.Enum | None = None) dict [source]#
Build the model.
- Parameters:
- coord_
tf.Tensor
The coordinates of atoms
- atype_
tf.Tensor
The atom types of atoms
- natoms
tf.Tensor
The number of atoms
- box
tf.Tensor
The box vectors
- mesh
tf.Tensor
The mesh vectors
- input_dict
dict
The input dict
- frz_model
str
,optional
The path to the frozen model
- ckpt_meta
str
,optional
The path prefix of the checkpoint and meta files
- suffix
str
,optional
The suffix of the scope
- reusebool or
tf.AUTO_REUSE
,optional
Whether to reuse the variables
- coord_
- Returns:
dict
The output dict
- get_fitting() deepmd.tf.fit.fitting.Fitting | dict [source]#
Get the fitting(s).
- init_variables(graph: deepmd.tf.env.tf.Graph, graph_def: deepmd.tf.env.tf.GraphDef, model_type: str = 'original_model', suffix: str = '') None [source]#
Init the embedding net variables with the given frozen model.
- enable_compression(suffix: str = '') None [source]#
Enable compression.
- Parameters:
- suffix
str
suffix to name scope
- suffix
- classmethod update_sel(train_data: deepmd.utils.data_system.DeepmdDataSystem, type_map: list[str] | None, local_jdata: dict) tuple[dict, float | None] [source]#
Update the selection and perform neighbor statistics.
- serialize(suffix: str = '') dict [source]#
Serialize the model.
There is no suffix in a native DP model, but it is important for the TF backend.
- classmethod deserialize(data: dict, suffix: str = '') NoReturn [source]#
Deserialize the model.
There is no suffix in a native DP model, but it is important for the TF backend.
- property input_requirement: list[deepmd.utils.data.DataRequirementItem][source]#
Return data requirements needed for the model input.