deepmd.tf.descriptor.se

Module Contents

Classes

DescrptSe

A base class for smooth version of descriptors.

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

Bases: deepmd.tf.descriptor.descriptor.Descriptor

A base class for smooth version of descriptors.

Notes

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

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

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

Precision of filter network.

_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)[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

classmethod update_sel(global_jdata: dict, local_jdata: dict)[source]

Update the selection and perform neighbor statistics.

Parameters:
global_jdatadict

The global data, containing the training section

local_jdatadict

The local data refer to the current class

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