deepmd.tf.model.pairtab#
Classes#
Pairwise tabulation energy model. |
Module Contents#
- class deepmd.tf.model.pairtab.PairTabModel(tab_file: str, rcut: float, sel: int | list[int], **kwargs: Any)[source]#
Bases:
deepmd.tf.model.model.ModelPairwise tabulation energy model.
This model can be used to tabulate the pairwise energy between atoms for either short-range or long-range interactions, such as D3, LJ, ZBL, etc. It should not be used alone, but rather as one submodel of a linear (sum) model, such as DP+D3.
Do not put the model on the first model of a linear model, since the linear model fetches the type map from the first model.
At this moment, the model does not smooth the energy at the cutoff radius, so one needs to make sure the energy has been smoothed to zero.
- Parameters:
- 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:
dictThe output dict
- 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.
- get_fitting() deepmd.tf.fit.fitting.Fitting | dict[source]#
Get the fitting(s).
- get_loss(loss: dict, lr: deepmd.tf.utils.learning_rate.LearningRateExp) deepmd.tf.loss.loss.Loss | dict | None[source]#
Get the loss function(s).
- 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.
- Parameters:
- Returns:
Notes
Do not modify the input data without copying it.
- property input_requirement: list[deepmd.utils.data.DataRequirementItem][source]#
Return data requirements needed for the model input.