deepmd.tf.utils.tabulate#
Attributes#
Classes#
Class for tabulation. |
Module Contents#
- 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]#
Bases:
deepmd.utils.tabulate.BaseTabulateClass 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
- _make_data(xx, idx)[source]#
Generate tabulation data for the given input.
- Parameters:
- xx
np.ndarray Input values to tabulate
- idx
int Index for accessing the correct network parameters
- xx
- Returns:
tuple[np.ndarray,np.ndarray,np.ndarray]Values, first derivatives, and second derivatives