deepmd.dpmodel.utils.type_embed

Module Contents

Classes

TypeEmbedNet

Type embedding network.

class deepmd.dpmodel.utils.type_embed.TypeEmbedNet(*, ntypes: int, neuron: List[int], resnet_dt: bool = False, activation_function: str = 'tanh', precision: str = 'default', trainable: bool = True, seed: int | None = None, padding: bool = False)[source]

Bases: deepmd.dpmodel.common.NativeOP

Type embedding network.

Parameters:
ntypesint

Number of atom types

neuronlist[int]

Number of neurons in each hidden layers of the embedding net

resnet_dt

Time-step dt in the resnet construction: y = x + dt * phi (Wx + b)

activation_function

The activation function in the embedding net. Supported options are “relu”, “tanh”, “none”, “linear”, “softplus”, “sigmoid”, “relu6”, “gelu”, “gelu_tf”.

precision

The precision of the embedding net parameters. Supported options are “float32”, “default”, “float16”, “float64”.

trainable

If the weights of embedding net are trainable.

seed

Random seed for initializing the network parameters.

padding

Concat the zero padding to the output, as the default embedding of empty type.

call() numpy.ndarray[source]

Compute the type embedding network.

classmethod deserialize(data: dict)[source]

Deserialize the model.

Parameters:
datadict

The serialized data

Returns:
Model

The deserialized model

serialize() dict[source]

Serialize the model.

Returns:
dict

The serialized data