deepmd.tf.fit.fitting
Module Contents
Classes
A class to remove type from input arguments. |
- class deepmd.tf.fit.fitting.Fitting[source]
Bases:
deepmd.tf.utils.PluginVariant
,make_plugin_registry
('fitting'
)A class to remove type from input arguments.
- abstract init_variables(graph: deepmd.tf.env.tf.Graph, graph_def: deepmd.tf.env.tf.GraphDef, suffix: str = '') None [source]
Init the fitting net variables with the given dict.
- Parameters:
Notes
This method is called by others when the fitting supported initialization from the given variables.
- abstract get_loss(loss: dict, lr) deepmd.tf.loss.loss.Loss [source]
Get the loss function.
- Parameters:
- loss
dict
the loss dict
- lr
LearningRateExp
the learning rate
- loss
- Returns:
Loss
the loss function
- classmethod deserialize(data: dict, suffix: str = '') Fitting [source]
Deserialize the fitting.
There is no suffix in a native DP model, but it is important for the TF backend.
- abstract serialize(suffix: str = '') dict [source]
Serialize the fitting.
There is no suffix in a native DP model, but it is important for the TF backend.
- serialize_network(ntypes: int, ndim: int, in_dim: int, neuron: List[int], activation_function: str, resnet_dt: bool, variables: dict, out_dim: int | None = 1, suffix: str = '') dict [source]
Serialize network.
- Parameters:
- ntypes
int
The number of types
- ndim
int
The dimension of elements
- in_dim
int
The input dimension
- neuron
List
[int
] The neuron list
- activation_function
str
The activation function
- resnet_dtbool
Whether to use resnet
- variables
dict
The input variables
- suffix
str
,optional
The suffix of the scope
- out_dim
int
,optional
The output dimension
- ntypes
- Returns:
dict
The converted network data