deepmd.pt.model.descriptor.repformers

Module Contents

Classes

DescrptBlockRepformers

The building block of descriptor.

Functions

torch_linear(*args, **kwargs)

border_op(→ torch.Tensor)

Attributes

mydtype

mydev

simple_linear

mylinear

deepmd.pt.model.descriptor.repformers.mydtype[source]
deepmd.pt.model.descriptor.repformers.mydev[source]
deepmd.pt.model.descriptor.repformers.torch_linear(*args, **kwargs)[source]
deepmd.pt.model.descriptor.repformers.simple_linear[source]
deepmd.pt.model.descriptor.repformers.mylinear[source]
deepmd.pt.model.descriptor.repformers.border_op(argument0, argument1, argument2, argument3, argument4, argument5, argument6, argument7, argument8) torch.Tensor[source]
class deepmd.pt.model.descriptor.repformers.DescrptBlockRepformers(rcut, rcut_smth, sel: int, ntypes: int, nlayers: int = 3, g1_dim=128, g2_dim=16, axis_dim: int = 4, direct_dist: bool = False, do_bn_mode: str = 'no', bn_momentum: float = 0.1, 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', set_davg_zero: bool = True, smooth: bool = True, add_type_ebd_to_seq: bool = False, exclude_types: List[Tuple[int, int]] = [], env_protection: float = 0.0, type: str | None = None)[source]

Bases: deepmd.pt.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.

property dim_out[source]

Returns the output dimension of this descriptor.

property dim_in[source]

Returns the atomic input dimension of this descriptor.

property dim_emb[source]

Returns the embedding dimension g2.

get_rcut() float[source]

Returns the cut-off radius.

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.

mixed_types() bool[source]

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

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

reinit_exclude(exclude_types: List[Tuple[int, int]] = [])[source]
forward(nlist: torch.Tensor, extended_coord: torch.Tensor, extended_atype: torch.Tensor, extended_atype_embd: torch.Tensor | None = None, mapping: torch.Tensor | None = None, comm_dict: Dict[str, torch.Tensor] | None = None)[source]

Calculate DescriptorBlock.

compute_input_stats(merged: Callable[[], List[dict]] | List[dict], path: deepmd.utils.path.DPPath | 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: torch.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.