deepmd.nvnmd.entrypoints package

class deepmd.nvnmd.entrypoints.MapTable(config_file: str, weight_file: str, map_file: str)[source]

Bases: object

Generate the mapping table describing the relastionship of atomic distance, cutoff function, and embedding matrix.

three mapping table will be built:

\(r^2_{ji} \rightarrow s_{ji}\)
\(r^2_{ji} \rightarrow sr_{ji}\)
\(r^2_{ji} \rightarrow \mathcal{G}_{ji}\)

where \(s_{ji}\) is cut-off function, \(sr_{ji} = \frac{s(r_{ji})}{r_{ji}}\), and \(\mathcal{G}_{ji}\) is embedding matrix.

The mapping funciton can be define as:

\(y = f(x) = y_{k} + (x - x_{k}) * dy_{k}\)
\(y_{k} = f(x_{k})\)
\(dy_{k} = \frac{f(x_{k+1}) - f(x_{k})}{dx}\)
\(x_{k} \leq x < x_{k+1}\)
\(x_{k} = k * dx\)

where \(dx\) is interpolation interval.

Parameters
config_file

input file name an .npy file containing the configuration information of NVNMD model

weight_file

input file name an .npy file containing the weights of NVNMD model

map_file

output file name an .npy file containing the mapping tables of NVNMD model

References

DOI: 10.1038/s41524-022-00773-z

Methods

build_dG_ds

build_ds_dr

build_map

build_r2s

build_r2s_r2ds

build_s2G

build_s2G_s2dG

qqq

run_s2G

run_u2s

build_dG_ds(G, s)[source]
build_ds_dr(r2, s, sr)[source]
build_map()[source]
build_r2s(r2)[source]
build_r2s_r2ds()[source]
build_s2G(s)[source]
build_s2G_s2dG()[source]
qqq(dat, NBIT_FEA_FL, NBIT_FEA_X, is_set_zero=False)[source]
run_s2G(dat)[source]
run_u2s()[source]
class deepmd.nvnmd.entrypoints.Wrap(config_file: str, weight_file: str, map_file: str, model_file: str)[source]

Bases: object

Generate the binary model file (model.pb) the model file can be use to run the NVNMD with lammps the pair style need set as:

pair_style nvnmd model.pb
pair_coeff * *
Parameters
config_file

input file name an .npy file containing the configuration information of NVNMD model

weight_file

input file name an .npy file containing the weights of NVNMD model

map_file

input file name an .npy file containing the mapping tables of NVNMD model

model_file

output file name an .pb file containing the model using in the NVNMD

References

DOI: 10.1038/s41524-022-00773-z

Methods

wrap_dscp()

Wrap the configuration of descriptor

wrap_fitn()

Wrap the weights of fitting net

wrap_map()

Wrap the mapping table of embedding network

wrap

wrap_bias

wrap_head

wrap_weight

wrap()[source]
wrap_bias(bias, NBIT_SUM, NBIT_DATA_FL)[source]
wrap_dscp()[source]

Wrap the configuration of descriptor

wrap_fitn()[source]

Wrap the weights of fitting net

wrap_head(NCFG, NNET, NFEA)[source]
wrap_map()[source]

Wrap the mapping table of embedding network

wrap_weight(weight, NBIT_WEIGHT, NBIT_WEIGHT_FL)[source]
deepmd.nvnmd.entrypoints.save_weight(sess, file_name: str = 'nvnmd/weight.npy')[source]

Save the dictionary of weight to a npy file

Submodules

deepmd.nvnmd.entrypoints.freeze module

deepmd.nvnmd.entrypoints.freeze.filter_tensorVariableList(tensorVariableList) dict[source]

Get the name of variable for NVNMD

descrpt_attr/t_avg:0
descrpt_attr/t_std:0
filter_type_{atom i}/matrix_{layer l}_{atomj}:0
filter_type_{atom i}/bias_{layer l}_{atomj}:0
layer_{layer l}_type_{atom i}/matrix:0
layer_{layer l}_type_{atom i}/bias:0
final_layer_type_{atom i}/matrix:0
final_layer_type_{atom i}/bias:0
deepmd.nvnmd.entrypoints.freeze.save_weight(sess, file_name: str = 'nvnmd/weight.npy')[source]

Save the dictionary of weight to a npy file

deepmd.nvnmd.entrypoints.mapt module

class deepmd.nvnmd.entrypoints.mapt.MapTable(config_file: str, weight_file: str, map_file: str)[source]

Bases: object

Generate the mapping table describing the relastionship of atomic distance, cutoff function, and embedding matrix.

three mapping table will be built:

\(r^2_{ji} \rightarrow s_{ji}\)
\(r^2_{ji} \rightarrow sr_{ji}\)
\(r^2_{ji} \rightarrow \mathcal{G}_{ji}\)

where \(s_{ji}\) is cut-off function, \(sr_{ji} = \frac{s(r_{ji})}{r_{ji}}\), and \(\mathcal{G}_{ji}\) is embedding matrix.

The mapping funciton can be define as:

\(y = f(x) = y_{k} + (x - x_{k}) * dy_{k}\)
\(y_{k} = f(x_{k})\)
\(dy_{k} = \frac{f(x_{k+1}) - f(x_{k})}{dx}\)
\(x_{k} \leq x < x_{k+1}\)
\(x_{k} = k * dx\)

where \(dx\) is interpolation interval.

Parameters
config_file

input file name an .npy file containing the configuration information of NVNMD model

weight_file

input file name an .npy file containing the weights of NVNMD model

map_file

output file name an .npy file containing the mapping tables of NVNMD model

References

DOI: 10.1038/s41524-022-00773-z

Methods

build_dG_ds

build_ds_dr

build_map

build_r2s

build_r2s_r2ds

build_s2G

build_s2G_s2dG

qqq

run_s2G

run_u2s

build_dG_ds(G, s)[source]
build_ds_dr(r2, s, sr)[source]
build_map()[source]
build_r2s(r2)[source]
build_r2s_r2ds()[source]
build_s2G(s)[source]
build_s2G_s2dG()[source]
qqq(dat, NBIT_FEA_FL, NBIT_FEA_X, is_set_zero=False)[source]
run_s2G(dat)[source]
run_u2s()[source]
deepmd.nvnmd.entrypoints.mapt.mapt(*, nvnmd_config: Optional[str] = 'nvnmd/config.npy', nvnmd_weight: Optional[str] = 'nvnmd/weight.npy', nvnmd_map: Optional[str] = 'nvnmd/map.npy', **kwargs)[source]

deepmd.nvnmd.entrypoints.train module

deepmd.nvnmd.entrypoints.train.add_path(p, p2)[source]
deepmd.nvnmd.entrypoints.train.normalized_input(fn, PATH_CNN)[source]

Normalize a input script file for continuous neural network

deepmd.nvnmd.entrypoints.train.normalized_input_qnn(jdata, PATH_QNN, CONFIG_CNN, WEIGHT_CNN, MAP_CNN)[source]

Normalize a input script file for quantize neural network

deepmd.nvnmd.entrypoints.train.replace_path(p, p2)[source]
deepmd.nvnmd.entrypoints.train.train_nvnmd(*, INPUT: str, step: str, **kwargs)[source]

deepmd.nvnmd.entrypoints.wrap module

class deepmd.nvnmd.entrypoints.wrap.Wrap(config_file: str, weight_file: str, map_file: str, model_file: str)[source]

Bases: object

Generate the binary model file (model.pb) the model file can be use to run the NVNMD with lammps the pair style need set as:

pair_style nvnmd model.pb
pair_coeff * *
Parameters
config_file

input file name an .npy file containing the configuration information of NVNMD model

weight_file

input file name an .npy file containing the weights of NVNMD model

map_file

input file name an .npy file containing the mapping tables of NVNMD model

model_file

output file name an .pb file containing the model using in the NVNMD

References

DOI: 10.1038/s41524-022-00773-z

Methods

wrap_dscp()

Wrap the configuration of descriptor

wrap_fitn()

Wrap the weights of fitting net

wrap_map()

Wrap the mapping table of embedding network

wrap

wrap_bias

wrap_head

wrap_weight

wrap()[source]
wrap_bias(bias, NBIT_SUM, NBIT_DATA_FL)[source]
wrap_dscp()[source]

Wrap the configuration of descriptor

wrap_fitn()[source]

Wrap the weights of fitting net

wrap_head(NCFG, NNET, NFEA)[source]
wrap_map()[source]

Wrap the mapping table of embedding network

wrap_weight(weight, NBIT_WEIGHT, NBIT_WEIGHT_FL)[source]
deepmd.nvnmd.entrypoints.wrap.wrap(*, nvnmd_config: Optional[str] = 'nvnmd/config.npy', nvnmd_weight: Optional[str] = 'nvnmd/weight.npy', nvnmd_map: Optional[str] = 'nvnmd/map.npy', nvnmd_model: Optional[str] = 'nvnmd/model.pb', **kwargs)[source]