deepmd.tf.model.pairwise_dprc#
Classes#
Pairwise Deep Potential - Range Correction. |
Functions#
| Call tf.gather but allow indices to contain placeholders (-1). |
Module Contents#
- class deepmd.tf.model.pairwise_dprc.PairwiseDPRc(qm_model: dict, qmmm_model: dict, type_embedding: dict | deepmd.tf.utils.type_embed.TypeEmbedNet, type_map: list[str], data_stat_nbatch: int = 10, data_stat_nsample: int = 10, data_stat_protect: float = 0.01, use_srtab: str | None = None, smin_alpha: float | None = None, sw_rmin: float | None = None, sw_rmax: float | None = None, spin: deepmd.tf.utils.spin.Spin | None = None, compress: dict | None = None, **kwargs)[source]#
Bases:
deepmd.tf.model.model.ModelPairwise Deep Potential - Range Correction.
- 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=None, ckpt_meta: str | None = None, suffix: str = '', reuse: bool | None = None)[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:
dictThe output dict
- get_loss(loss: dict, lr) deepmd.tf.loss.loss.Loss | dict[source]#
Get the loss function(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
- get_feed_dict(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, **kwargs) dict[str, deepmd.tf.env.tf.Tensor][source]#
Generate the feed_dict for current descriptor.
- Parameters:
- coord_
tf.Tensor The coordinate of atoms
- atype_
tf.Tensor The type of atoms
- natoms
tf.Tensor The number of atoms. This tensor has the length of Ntypes + 2 natoms[0]: number of local atoms natoms[1]: total number of atoms held by this processor natoms[i]: 2 <= i < Ntypes+2, number of type i atoms
- box
tf.Tensor The box. Can be generated by deepmd.tf.model.make_stat_input
- mesh
tf.Tensor For historical reasons, only the length of the Tensor matters. if size of mesh == 6, pbc is assumed. if size of mesh == 0, no-pbc is assumed.
- aparam
tf.Tensor The parameters of the descriptor
- **kwargs
dict The keyword arguments
- coord_
- Returns:
- 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.
- property input_requirement: list[deepmd.utils.data.DataRequirementItem][source]#
Return data requirements needed for the model input.