deepmd.dpmodel.descriptor.se_t#
Classes#
DeepPot-SE constructed from all information (both angular and radial) of atomic |
Module Contents#
- class deepmd.dpmodel.descriptor.se_t.DescrptSeT(rcut: float, rcut_smth: float, sel: list[int], neuron: list[int] = [24, 48, 96], resnet_dt: bool = False, set_davg_zero: bool = False, activation_function: str = 'tanh', env_protection: float = 0.0, exclude_types: list[tuple[int, int]] = [], precision: str = DEFAULT_PRECISION, trainable: bool = True, seed: int | list[int] | None = None, type_map: list[str] | None = None, ntypes: int | None = None)[source]#
Bases:
deepmd.dpmodel.NativeOP,deepmd.dpmodel.descriptor.base_descriptor.BaseDescriptorDeepPot-SE constructed from all information (both angular and radial) of atomic configurations.
The embedding takes angles between two neighboring atoms as input.
- Parameters:
- rcut
float The cut-off radius
- rcut_smth
float From where the environment matrix should be smoothed
- sel
list[int] sel[i] specifies the maxmum number of type i atoms in the cut-off radius
- neuron
list[int] Number of neurons in each hidden layers of the embedding net
- resnet_dtbool
Time-step dt in the resnet construction: y = x + dt * phi (Wx + b)
- set_davg_zerobool
Set the shift of embedding net input to zero.
- activation_function
str The activation function in the embedding net. Supported options are “silut”, “silu”, “relu”, “relu6”, “sigmoid”, “linear”, “tanh”, “none”, “softplus”, “gelu”, “gelu_tf”.
- env_protection
float Protection parameter to prevent division by zero errors during environment matrix calculations.
- exclude_types
list[list[int]] The excluded pairs of types which have no interaction with each other. For example, [[0, 1]] means no interaction between type 0 and type 1.
- precision
str The precision of the embedding net parameters. Supported options are “float32”, “default”, “float16”, “float64”.
- trainablebool
If the weights of embedding net are trainable.
- seed
int,Optional Random seed for initializing the network parameters.
- type_map: list[str], Optional
A list of strings. Give the name to each type of atoms.
- ntypes
int Number of element types. Not used in this descriptor, only to be compat with input.
- rcut
- abstractmethod 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.
- get_rcut_smth() float[source]#
Returns the radius where the neighbor information starts to smoothly decay to 0.
- mixed_types() bool[source]#
Returns if the descriptor requires a neighbor list that distinguish different atomic types or not.
- need_sorted_nlist_for_lower() bool[source]#
Returns whether the descriptor needs sorted nlist when using forward_lower.
Share the parameters of self to the base_class with shared_level during multitask training. If not start from checkpoint (resume is False), some separated parameters (e.g. mean and stddev) will be re-calculated across different classes.
- compute_input_stats(merged: Callable[[], list[dict]] | list[dict], path: deepmd.utils.path.DPPath | None = None) None[source]#
Compute the input statistics (e.g. mean and stddev) for the descriptors from packed data.
- Parameters:
- merged
Union[Callable[[],list[dict]],list[dict]] - list[dict]: A list of data samples from various data systems.
Each element, merged[i], is a data dictionary containing keys: paddle.Tensor originating from the i-th data system.
- Callable[[], list[dict]]: A lazy function that returns data samples in the above format
only when needed. Since the sampling process can be slow and memory-intensive, the lazy function helps by only sampling once.
- path
Optional[DPPath] The path to the stat file.
- merged
- set_stat_mean_and_stddev(mean: numpy.ndarray, stddev: numpy.ndarray) None[source]#
Update mean and stddev for descriptor.
- get_stat_mean_and_stddev() tuple[numpy.ndarray, numpy.ndarray][source]#
Get mean and stddev for descriptor.
- call(coord_ext, atype_ext, nlist, mapping: numpy.ndarray | None = None)[source]#
Compute the descriptor.
- Parameters:
- coord_ext
The extended coordinates of atoms. shape: nf x (nallx3)
- atype_ext
The extended aotm types. shape: nf x nall
- nlist
The neighbor list. shape: nf x nloc x nnei
- mapping
The index mapping from extended to local region. not used by this descriptor.
- Returns:
descriptorThe descriptor. shape: nf x nloc x ng
grThe rotationally equivariant and permutationally invariant single particle representation. This descriptor returns None.
g2The rotationally invariant pair-partical representation. This descriptor returns None.
h2The rotationally equivariant pair-partical representation. This descriptor returns None.
swThe smooth switch function.
- classmethod deserialize(data: dict) DescrptSeT[source]#
Deserialize from dict.