deepmd.tf.utils.tabulate
Module Contents
Classes
Class for tabulation. |
Attributes
- class deepmd.tf.utils.tabulate.DPTabulate(descrpt: deepmd.tf.descriptor.Descriptor, neuron: List[int], graph: deepmd.tf.env.tf.Graph, graph_def: deepmd.tf.env.tf.GraphDef, type_one_side: bool = False, exclude_types: List[List[int]] = [], activation_fn: Callable[[deepmd.tf.env.tf.Tensor], deepmd.tf.env.tf.Tensor] = tf.nn.tanh, suffix: str = '')[source]
Class for tabulation.
Compress a model, which including tabulating the embedding-net. The table is composed of fifth-order polynomial coefficients and is assembled from two sub-tables. The first table takes the stride(parameter) as it’s uniform stride, while the second table takes 10 * stride as it’s uniform stride The range of the first table is automatically detected by deepmd-kit, while the second table ranges from the first table’s upper boundary(upper) to the extrapolate(parameter) * upper.
- Parameters:
- descrpt
Descriptor of the original model
- neuron
Number of neurons in each hidden layers of the embedding net \(\\mathcal{N}\)
- graph
tf.Graph
The graph of the original model
- graph_def
tf.GraphDef
The graph_def of the original model
- type_one_side
Try to build N_types tables. Otherwise, building N_types^2 tables
- exclude_types
List
[List
[int
]] The excluded pairs of types which have no interaction with each other. For example, [[0, 1]] means no interaction between type 0 and type 1.
- activation_function
The activation function in the embedding net. Supported options are {“tanh”,”gelu”} in common.ACTIVATION_FN_DICT.
- suffix
str
,optional
The suffix of the scope
- build(min_nbor_dist: float, extrapolate: float, stride0: float, stride1: float) Tuple[Dict[str, int], Dict[str, int]] [source]
Build the tables for model compression.
- Parameters:
- min_nbor_dist
The nearest distance between neighbor atoms
- extrapolate
The scale of model extrapolation
- stride0
The uniform stride of the first table
- stride1
The uniform stride of the second table
- Returns: