deepmd.pd.model.descriptor.repformers

Contents

deepmd.pd.model.descriptor.repformers#

Classes#

DescrptBlockRepformers

The building block of descriptor.

Functions#

border_op(→ paddle.Tensor)

Module Contents#

deepmd.pd.model.descriptor.repformers.border_op(argument0: paddle.Tensor, argument1: paddle.Tensor, argument2: paddle.Tensor, argument3: paddle.Tensor, argument4: paddle.Tensor, argument5: paddle.Tensor, argument6: paddle.Tensor, argument7: paddle.Tensor, argument8: paddle.Tensor) paddle.Tensor[source]#
class deepmd.pd.model.descriptor.repformers.DescrptBlockRepformers(rcut: float, rcut_smth: float, sel: int, ntypes: int, nlayers: int = 3, g1_dim: int = 128, g2_dim: int = 16, axis_neuron: int = 4, direct_dist: bool = False, update_g1_has_conv: bool = True, update_g1_has_drrd: bool = True, update_g1_has_grrg: bool = True, update_g1_has_attn: bool = True, update_g2_has_g1g1: bool = True, update_g2_has_attn: bool = True, update_h2: bool = False, attn1_hidden: int = 64, attn1_nhead: int = 4, attn2_hidden: int = 16, attn2_nhead: int = 4, attn2_has_gate: bool = False, activation_function: str = 'tanh', update_style: str = 'res_avg', update_residual: float = 0.001, update_residual_init: str = 'norm', set_davg_zero: bool = True, smooth: bool = True, exclude_types: list[tuple[int, int]] = [], env_protection: float = 0.0, precision: str = 'float64', trainable_ln: bool = True, ln_eps: float | None = 1e-05, seed: int | list[int] | None = None, use_sqrt_nnei: bool = True, g1_out_conv: bool = True, g1_out_mlp: bool = True, trainable: bool = True)[source]#

Bases: deepmd.pd.model.descriptor.descriptor.DescriptorBlock

The building block of descriptor. Given the input descriptor, provide with the atomic coordinates, atomic types and neighbor list, calculate the new descriptor.

rcut[source]#
rcut_smth[source]#
ntypes[source]#
nlayers = 3[source]#
nnei[source]#
ndescrpt[source]#
sel[source]#
sec[source]#
split_sel[source]#
axis_neuron = 4[source]#
set_davg_zero = True[source]#
g1_dim = 128[source]#
g2_dim = 16[source]#
update_g1_has_conv = True[source]#
update_g1_has_drrd = True[source]#
update_g1_has_grrg = True[source]#
update_g1_has_attn = True[source]#
update_g2_has_g1g1 = True[source]#
update_g2_has_attn = True[source]#
update_h2 = False[source]#
attn1_hidden = 64[source]#
attn1_nhead = 4[source]#
attn2_has_gate = False[source]#
attn2_hidden = 16[source]#
attn2_nhead = 4[source]#
activation_function = 'tanh'[source]#
update_style = 'res_avg'[source]#
update_residual = 0.001[source]#
update_residual_init = 'norm'[source]#
direct_dist = False[source]#
act[source]#
smooth = True[source]#
use_sqrt_nnei = True[source]#
g1_out_conv = True[source]#
g1_out_mlp = True[source]#
env_protection = 0.0[source]#
precision = 'float64'[source]#
prec[source]#
trainable_ln = True[source]#
ln_eps = 1e-05[source]#
epsilon = 0.0001[source]#
seed = None[source]#
g2_embd[source]#
layers[source]#
stats = None[source]#
get_rcut() float[source]#

Returns the cut-off radius.

get_rcut_smth() float[source]#

Returns the radius where the neighbor information starts to smoothly decay to 0.

get_buffer_rcut() paddle.Tensor[source]#

Returns the cut-off radius as a buffer-style Tensor.

get_buffer_rcut_smth() paddle.Tensor[source]#

Returns the radius where the neighbor information starts to smoothly decay to 0 as a buffer-style Tensor.

get_nsel() int[source]#

Returns the number of selected atoms in the cut-off radius.

get_sel() list[int][source]#

Returns the number of selected atoms for each type.

get_ntypes() int[source]#

Returns the number of element types.

get_dim_out() int[source]#

Returns the output dimension.

get_dim_in() int[source]#

Returns the input dimension.

get_dim_emb() int[source]#

Returns the embedding dimension g2.

__setitem__(key: str, value: paddle.Tensor) None[source]#
__getitem__(key: str) paddle.Tensor[source]#
mixed_types() bool[source]#

If true, the descriptor 1. assumes total number of atoms aligned across frames; 2. requires a neighbor list that does not distinguish different atomic types.

If false, the descriptor 1. assumes total number of atoms of each atom type aligned across frames; 2. requires a neighbor list that distinguishes different atomic types.

get_env_protection() float[source]#

Returns the protection of building environment matrix.

property dim_out: int[source]#

Returns the output dimension of this descriptor.

property dim_in: int[source]#

Returns the atomic input dimension of this descriptor.

property dim_emb: int[source]#

Returns the embedding dimension g2.

reinit_exclude(exclude_types: list[tuple[int, int]] = []) None[source]#
forward(nlist: paddle.Tensor, extended_coord: paddle.Tensor, extended_atype: paddle.Tensor, extended_atype_embd: paddle.Tensor | None = None, mapping: paddle.Tensor | None = None, type_embedding: paddle.Tensor | None = None, comm_dict: list[paddle.Tensor] | None = None) paddle.Tensor[source]#

Calculate DescriptorBlock.

compute_input_stats(merged: collections.abc.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:
mergedUnion[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.

pathOptional[DPPath]

The path to the stat file.

get_stats() dict[str, deepmd.utils.env_mat_stat.StatItem][source]#

Get the statistics of the descriptor.

has_message_passing() bool[source]#

Returns whether the descriptor block has message passing.

need_sorted_nlist_for_lower() bool[source]#

Returns whether the descriptor block needs sorted nlist when using forward_lower.