deepmd.pt.model.descriptor.gaussian_lcc

Module Contents

Classes

DescrptGaussianLcc

Base class for all neural network modules.

class deepmd.pt.model.descriptor.gaussian_lcc.DescrptGaussianLcc(rcut, rcut_smth, sel: int, ntypes: int, num_pair: int, embed_dim: int = 768, kernel_num: int = 128, pair_embed_dim: int = 64, num_block: int = 1, layer_num: int = 12, attn_head: int = 48, pair_hidden_dim: int = 16, ffn_embedding_dim: int = 768, dropout: float = 0.0, droppath_prob: float = 0.1, pair_dropout: float = 0.25, attention_dropout: float = 0.1, activation_dropout: float = 0.1, pre_ln: bool = True, do_tag_embedding: bool = False, tag_ener_pref: bool = False, atomic_sum_gbf: bool = False, pre_add_seq: bool = True, tri_update: bool = True, **kwargs)[source]

Bases: torch.nn.Module, deepmd.pt.model.descriptor.base_descriptor.BaseDescriptor

Base class for all neural network modules.

Your models should also subclass this class.

Modules can also contain other Modules, allowing to nest them in a tree structure. You can assign the submodules as regular attributes:

import torch.nn as nn
import torch.nn.functional as F

class Model(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv1 = nn.Conv2d(1, 20, 5)
        self.conv2 = nn.Conv2d(20, 20, 5)

    def forward(self, x):
        x = F.relu(self.conv1(x))
        return F.relu(self.conv2(x))

Submodules assigned in this way will be registered, and will have their parameters converted too when you call to(), etc.

Note

As per the example above, an __init__() call to the parent class must be made before assignment on the child.

Variables:

training (bool) – Boolean represents whether this module is in training or evaluation mode.

property dim_out[source]

Returns the output dimension of atomic representation.

property dim_in[source]

Returns the atomic input dimension of this descriptor.

property dim_emb[source]

Returns the output dimension of pair representation.

compute_input_stats(merged: List[dict], path: deepmd.utils.path.DPPath | None = None)[source]

Update mean and stddev for descriptor elements.

forward(extended_coord, nlist, atype, nlist_type, nlist_loc=None, atype_tebd=None, nlist_tebd=None, seq_input=None)[source]

Calculate the atomic and pair representations of this descriptor.

Args: - extended_coord: Copied atom coordinates with shape [nframes, nall, 3]. - nlist: Neighbor list with shape [nframes, nloc, nnei]. - atype: Atom type with shape [nframes, nloc]. - nlist_type: Atom type of neighbors with shape [nframes, nloc, nnei]. - nlist_loc: Local index of neighbor list with shape [nframes, nloc, nnei]. - atype_tebd: Atomic type embedding with shape [nframes, nloc, tebd_dim]. - nlist_tebd: Type embeddings of neighbor with shape [nframes, nloc, nnei, tebd_dim]. - seq_input: The sequential input from other descriptor with

shape [nframes, nloc, tebd_dim] or [nframes * nloc, 1 + nnei, tebd_dim]

Returns:
  • result: descriptor with shape [nframes, nloc, self.filter_neuron[-1] * self.axis_neuron].
  • ret: environment matrix with shape [nframes, nloc, self.neei, out_size]