deepmd.pt.model.task.polarizability

Module Contents

Classes

PolarFittingNet

Construct a polar fitting net.

Attributes

log

deepmd.pt.model.task.polarizability.log[source]
class deepmd.pt.model.task.polarizability.PolarFittingNet(ntypes: int, dim_descrpt: int, embedding_width: int, neuron: List[int] = [128, 128, 128], resnet_dt: bool = True, numb_fparam: int = 0, numb_aparam: int = 0, activation_function: str = 'tanh', precision: str = DEFAULT_PRECISION, mixed_types: bool = True, rcond: float | None = None, seed: int | None = None, exclude_types: List[int] = [], fit_diag: bool = True, scale: List[float] | float | None = None, shift_diag: bool = True, **kwargs)[source]

Bases: deepmd.pt.model.task.fitting.GeneralFitting

Construct a polar fitting net.

Parameters:
ntypesint

Element count.

dim_descrptint

Embedding width per atom.

embedding_widthint

The dimension of rotation matrix, m1.

neuronList[int]

Number of neurons in each hidden layers of the fitting net.

resnet_dtbool

Using time-step in the ResNet construction.

numb_fparamint

Number of frame parameters.

numb_aparamint

Number of atomic parameters.

activation_functionstr

Activation function.

precisionstr

Numerical precision.

mixed_typesbool

If true, use a uniform fitting net for all atom types, otherwise use different fitting nets for different atom types.

rcondfloat, optional

The condition number for the regression of atomic energy.

seedint, optional

Random seed.

fit_diagbool

Fit the diagonal part of the rotational invariant polarizability matrix, which will be converted to normal polarizability matrix by contracting with the rotation matrix.

scaleList[float]

The output of the fitting net (polarizability matrix) for type i atom will be scaled by scale[i]

shift_diagbool

Whether to shift the diagonal part of the polarizability matrix. The shift operation is carried out after scale.

exclude_types: List[int][source]
_net_out_dim()[source]

Set the FittingNet output dim.

__setitem__(key, value)[source]
__getitem__(key)[source]
serialize() dict[source]

Serialize the fitting to dict.

classmethod deserialize(data: dict) deepmd.pt.model.task.fitting.GeneralFitting[source]

Deserialize the fitting.

Parameters:
datadict

The serialized data

Returns:
BF

The deserialized fitting

output_def() deepmd.dpmodel.FittingOutputDef[source]

Returns the output def of the fitting net.

forward(descriptor: torch.Tensor, atype: torch.Tensor, gr: torch.Tensor | None = None, g2: torch.Tensor | None = None, h2: torch.Tensor | None = None, fparam: torch.Tensor | None = None, aparam: torch.Tensor | None = None)[source]