deepmd.dpmodel.utils.type_embed#
Classes#
Type embedding network. |
Functions#
|
Module Contents#
- 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 | list[int] | None = None, padding: bool = False, use_econf_tebd: bool = False, use_tebd_bias: bool = False, type_map: list[str] | None = None)[source]#
Bases:
deepmd.dpmodel.common.NativeOP
Type embedding network.
- Parameters:
- ntypes
int
Number of atom types
- neuron
list
[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 “none”, “gelu_tf”, “linear”, “relu6”, “sigmoid”, “tanh”, “gelu”, “relu”, “softplus”.
- precision
The precision of the embedding net parameters. Supported options are “float16”, “float64”, “default”, “float32”.
- 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.
- use_econf_tebd: bool, Optional
Whether to use electronic configuration type embedding.
- use_tebd_biasbool,
Optional
Whether to use bias in the type embedding layer.
- type_map: list[str], Optional
A list of strings. Give the name to each type of atoms.
- ntypes
- call() numpy.ndarray [source]#
Compute the type embedding network.
- classmethod deserialize(data: dict)[source]#
Deserialize the model.
- Parameters:
- data
dict
The serialized data
- data
- Returns:
Model
The deserialized model
- change_type_map(type_map: list[str], model_with_new_type_stat=None) None [source]#
Change the type related params to new ones, according to type_map and the original one in the model. If there are new types in type_map, statistics will be updated accordingly to model_with_new_type_stat for these new types.