deepmd.dpmodel.descriptor.hybrid

Module Contents

Classes

DescrptHybrid

Concate a list of descriptors to form a new descriptor.

class deepmd.dpmodel.descriptor.hybrid.DescrptHybrid(list: List[deepmd.dpmodel.descriptor.base_descriptor.BaseDescriptor | Dict[str, Any]])[source]

Bases: deepmd.dpmodel.descriptor.base_descriptor.BaseDescriptor, deepmd.dpmodel.common.NativeOP

Concate a list of descriptors to form a new descriptor.

Parameters:
listlistList[Union[BaseDescriptor, Dict[str, Any]]]

Build a descriptor from the concatenation of the list of descriptors. The descriptor can be either an object or a dictionary.

get_rcut() float[source]

Returns 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_emb() int[source]

Returns the output dimension.

mixed_types()[source]

Returns if the descriptor requires a neighbor list that distinguish different atomic types or not.

abstract share_params(base_class, shared_level, resume=False)[source]

Share the parameters of self to the base_class with shared_level during multitask training. If not start from checkpoint (resume is False), some seperated parameters (e.g. mean and stddev) will be re-calculated across different classes.

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

Update mean and stddev for descriptor elements.

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, not required by this descriptor.

Returns:
descriptor

The descriptor. shape: nf x nloc x (ng x axis_neuron)

gr

The rotationally equivariant and permutationally invariant single particle representation. shape: nf x nloc x ng x 3.

g2

The rotationally invariant pair-partical representation.

h2

The rotationally equivariant pair-partical representation.

sw

The smooth switch function.

classmethod update_sel(global_jdata: dict, local_jdata: dict) dict[source]

Update the selection and perform neighbor statistics.

Parameters:
global_jdatadict

The global data, containing the training section

local_jdatadict

The local data refer to the current class

serialize() dict[source]

Serialize the obj to dict.

classmethod deserialize(data: dict) DescrptHybrid[source]

Deserialize the model.

Parameters:
datadict

The serialized data

Returns:
BD

The deserialized descriptor