deepmd.tf.descriptor.se#

Classes#

DescrptSe

A base class for smooth version of descriptors.

Module Contents#

class deepmd.tf.descriptor.se.DescrptSe[source]#

Bases: deepmd.tf.descriptor.descriptor.Descriptor

A base class for smooth version of descriptors.

Attributes:
embedding_net_variablesdict

initial embedding network variables

descrpt_reshapetf.Tensor

the reshaped descriptor

descrpt_derivtf.Tensor

the descriptor derivative

rijtf.Tensor

distances between two atoms

nlisttf.Tensor

the neighbor list

Notes

All of these descriptors have an environmental matrix and an embedding network (deepmd.tf.utils.network.embedding_net()), so they can share some similar methods without defining them twice.

_identity_tensors(suffix: str = '') None[source]#

Identify tensors which are expected to be stored and restored.

Parameters:
suffixstr

The suffix of the scope

Notes

These tensors will be indentitied:

self.descrpt_reshape : o_rmat self.descrpt_deriv : o_rmat_deriv self.rij : o_rij self.nlist : o_nlist

Thus, this method should be called during building the descriptor and after these tensors are initialized.

get_tensor_names(suffix: str = '') tuple[str][source]#

Get names of tensors.

Parameters:
suffixstr

The suffix of the scope

Returns:
tuple[str]

Names of tensors

pass_tensors_from_frz_model(descrpt_reshape: deepmd.tf.env.tf.Tensor, descrpt_deriv: deepmd.tf.env.tf.Tensor, rij: deepmd.tf.env.tf.Tensor, nlist: deepmd.tf.env.tf.Tensor) None[source]#

Pass the descrpt_reshape tensor as well as descrpt_deriv tensor from the frz graph_def.

Parameters:
descrpt_reshape

The passed descrpt_reshape tensor

descrpt_deriv

The passed descrpt_deriv tensor

rij

The passed rij tensor

nlist

The passed nlist tensor

init_variables(graph: deepmd.tf.env.tf.Graph, graph_def: deepmd.tf.env.tf.GraphDef, suffix: str = '') None[source]#

Init the embedding net variables with the given dict.

Parameters:
graphtf.Graph

The input frozen model graph

graph_deftf.GraphDef

The input frozen model graph_def

suffixstr, optional

The suffix of the scope

property precision: deepmd.tf.env.tf.DType[source]#

Precision of filter network.

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:
train_dataDeepmdDataSystem

data used to do neighbor statistics

type_maplist[str], optional

The name of each type of atoms

local_jdatadict

The local data refer to the current class

Returns:
dict

The updated local data

float

The minimum distance between two atoms

serialize_network(ntypes: int, ndim: int, in_dim: int, neuron: list[int], activation_function: str, resnet_dt: bool, variables: dict, excluded_types: set[tuple[int, int]] = set(), suffix: str = '') dict[source]#

Serialize network.

Parameters:
ntypesint

The number of types

ndimint

The dimension of elements

in_dimint

The input dimension

neuronlist[int]

The neuron list

activation_functionstr

The activation function

resnet_dtbool

Whether to use resnet

variablesdict

The input variables

excluded_typesset[tuple[int, int]], optional

The excluded types

suffixstr, optional

The suffix of the scope

Returns:
dict

The converted network data

classmethod deserialize_network(data: dict, suffix: str = '') dict[source]#

Deserialize network.

Parameters:
datadict

The input network data

suffixstr, optional

The suffix of the scope

Returns:
variablesdict

The input variables