deepmd.model package

Submodules

deepmd.model.ener module

class deepmd.model.ener.EnerModel(descrpt, fitting, typeebd=None, type_map: Optional[List[str]] = None, data_stat_nbatch: int = 10, data_stat_protect: float = 0.01, use_srtab: Optional[str] = None, smin_alpha: Optional[float] = None, sw_rmin: Optional[float] = None, sw_rmax: Optional[float] = None)[source]

Bases: deepmd.model.model.Model

Energy model.

Parameters
descrpt

Descriptor

fitting

Fitting net

type_map

Mapping atom type to the name (str) of the type. For example type_map[1] gives the name of the type 1.

data_stat_nbatch

Number of frames used for data statistic

data_stat_protect

Protect parameter for atomic energy regression

use_srtab

The table for the short-range pairwise interaction added on top of DP. The table is a text data file with (N_t + 1) * N_t / 2 + 1 columes. The first colume is the distance between atoms. The second to the last columes are energies for pairs of certain types. For example we have two atom types, 0 and 1. The columes from 2nd to 4th are for 0-0, 0-1 and 1-1 correspondingly.

smin_alpha

The short-range tabulated interaction will be swithed according to the distance of the nearest neighbor. This distance is calculated by softmin. This parameter is the decaying parameter in the softmin. It is only required when use_srtab is provided.

sw_rmin

The lower boundary of the interpolation between short-range tabulated interaction and DP. It is only required when use_srtab is provided.

sw_rmin

The upper boundary of the interpolation between short-range tabulated interaction and DP. It is only required when use_srtab is provided.

Methods

init_variables(graph, graph_def[, ...])

Init the embedding net variables with the given frozen model

build

data_stat

get_ntypes

get_rcut

get_type_map

build(coord_, atype_, natoms, box, mesh, input_dict, frz_model=None, suffix='', reuse=None)[source]
data_stat(data)[source]
get_ntypes()[source]
get_rcut()[source]
get_type_map()[source]
init_variables(graph: tensorflow.python.framework.ops.Graph, graph_def: tensorflow.core.framework.graph_pb2.GraphDef, model_type: str = 'original_model', suffix: str = '') None[source]

Init the embedding net variables with the given frozen model

Parameters
graphtf.Graph

The input frozen model graph

graph_deftf.GraphDef

The input frozen model graph_def

model_typestr

the type of the model

suffixstr

suffix to name scope

model_type = 'ener'

deepmd.model.model module

class deepmd.model.model.Model[source]

Bases: object

Methods

init_variables(graph, graph_def[, ...])

Init the embedding net variables with the given frozen model

init_variables(graph: tensorflow.python.framework.ops.Graph, graph_def: tensorflow.core.framework.graph_pb2.GraphDef, model_type: str = 'original_model', suffix: str = '') None[source]

Init the embedding net variables with the given frozen model

Parameters
graphtf.Graph

The input frozen model graph

graph_deftf.GraphDef

The input frozen model graph_def

model_typestr

the type of the model

suffixstr

suffix to name scope

deepmd.model.model_stat module

deepmd.model.model_stat.make_stat_input(data, nbatches, merge_sys=True)[source]

pack data for statistics

Parameters
data:

The data

merge_sys: bool (True)

Merge system data

Returns
all_stat:

A dictionary of list of list storing data for stat. if merge_sys == False data can be accessed by

all_stat[key][sys_idx][batch_idx][frame_idx]

else merge_sys == True can be accessed by

all_stat[key][batch_idx][frame_idx]

deepmd.model.model_stat.merge_sys_stat(all_stat)[source]

deepmd.model.tensor module

class deepmd.model.tensor.DipoleModel(descrpt, fitting, type_map: Optional[List[str]] = None, data_stat_nbatch: int = 10, data_stat_protect: float = 0.01)[source]

Bases: deepmd.model.tensor.TensorModel

Methods

init_variables(graph, graph_def[, ...])

Init the embedding net variables with the given frozen model

build

data_stat

get_ntypes

get_out_size

get_rcut

get_sel_type

get_type_map

class deepmd.model.tensor.GlobalPolarModel(descrpt, fitting, type_map: Optional[List[str]] = None, data_stat_nbatch: int = 10, data_stat_protect: float = 0.01)[source]

Bases: deepmd.model.tensor.TensorModel

Methods

init_variables(graph, graph_def[, ...])

Init the embedding net variables with the given frozen model

build

data_stat

get_ntypes

get_out_size

get_rcut

get_sel_type

get_type_map

class deepmd.model.tensor.PolarModel(descrpt, fitting, type_map: Optional[List[str]] = None, data_stat_nbatch: int = 10, data_stat_protect: float = 0.01)[source]

Bases: deepmd.model.tensor.TensorModel

Methods

init_variables(graph, graph_def[, ...])

Init the embedding net variables with the given frozen model

build

data_stat

get_ntypes

get_out_size

get_rcut

get_sel_type

get_type_map

class deepmd.model.tensor.TensorModel(tensor_name: str, descrpt, fitting, type_map: Optional[List[str]] = None, data_stat_nbatch: int = 10, data_stat_protect: float = 0.01)[source]

Bases: deepmd.model.model.Model

Tensor model.

Parameters
tensor_name

Name of the tensor.

descrpt

Descriptor

fitting

Fitting net

type_map

Mapping atom type to the name (str) of the type. For example type_map[1] gives the name of the type 1.

data_stat_nbatch

Number of frames used for data statistic

data_stat_protect

Protect parameter for atomic energy regression

Methods

init_variables(graph, graph_def[, ...])

Init the embedding net variables with the given frozen model

build

data_stat

get_ntypes

get_out_size

get_rcut

get_sel_type

get_type_map

build(coord_, atype_, natoms, box, mesh, input_dict, frz_model=None, suffix='', reuse=None)[source]
data_stat(data)[source]
get_ntypes()[source]
get_out_size()[source]
get_rcut()[source]
get_sel_type()[source]
get_type_map()[source]
init_variables(graph: tensorflow.python.framework.ops.Graph, graph_def: tensorflow.core.framework.graph_pb2.GraphDef, model_type: str = 'original_model', suffix: str = '') None[source]

Init the embedding net variables with the given frozen model

Parameters
graphtf.Graph

The input frozen model graph

graph_deftf.GraphDef

The input frozen model graph_def

model_typestr

the type of the model

suffixstr

suffix to name scope

class deepmd.model.tensor.WFCModel(descrpt, fitting, type_map: Optional[List[str]] = None, data_stat_nbatch: int = 10, data_stat_protect: float = 0.01)[source]

Bases: deepmd.model.tensor.TensorModel

Methods

init_variables(graph, graph_def[, ...])

Init the embedding net variables with the given frozen model

build

data_stat

get_ntypes

get_out_size

get_rcut

get_sel_type

get_type_map