deepmd.tf.nvnmd.utils.network#

Attributes#

Functions#

get_sess(→ deepmd.tf.env.tf.Session)

matmul2_qq(→ deepmd.tf.env.tf.Tensor)

Quantized matmul operation for 2d tensor.

matmul3_qq(→ deepmd.tf.env.tf.Tensor)

Quantized matmul operation for 3d tensor.

qf(→ deepmd.tf.env.tf.Tensor)

Quantize and floor tensor x with quantification precision nbit.

qr(→ deepmd.tf.env.tf.Tensor)

Quantize and round tensor x with quantification precision nbit.

tanh4(→ deepmd.tf.env.tf.Tensor)

one_layer_wb(→ tuple[deepmd.tf.env.tf.Variable, ...)

one_layer_t(→ deepmd.tf.env.tf.Variable)

one_layer(→ deepmd.tf.env.tf.Tensor)

Build one layer with continuous or quantized value.

Module Contents#

deepmd.tf.nvnmd.utils.network.log[source]#
deepmd.tf.nvnmd.utils.network.get_sess() deepmd.tf.env.tf.Session[source]#
deepmd.tf.nvnmd.utils.network.matmul2_qq(a: deepmd.tf.env.tf.Tensor, b: deepmd.tf.env.tf.Tensor, nbit: int) deepmd.tf.env.tf.Tensor[source]#

Quantized matmul operation for 2d tensor. a and b is input tensor, nbit represent quantification precision.

deepmd.tf.nvnmd.utils.network.matmul3_qq(a: deepmd.tf.env.tf.Tensor, b: deepmd.tf.env.tf.Tensor, nbit: int) deepmd.tf.env.tf.Tensor[source]#

Quantized matmul operation for 3d tensor. a and b is input tensor, nbit represent quantification precision.

deepmd.tf.nvnmd.utils.network.qf(x: deepmd.tf.env.tf.Tensor, nbit: int) deepmd.tf.env.tf.Tensor[source]#

Quantize and floor tensor x with quantification precision nbit.

deepmd.tf.nvnmd.utils.network.qr(x: deepmd.tf.env.tf.Tensor, nbit: int) deepmd.tf.env.tf.Tensor[source]#

Quantize and round tensor x with quantification precision nbit.

deepmd.tf.nvnmd.utils.network.tanh4(x: deepmd.tf.env.tf.Tensor) deepmd.tf.env.tf.Tensor[source]#
deepmd.tf.nvnmd.utils.network.one_layer_wb(shape: list[int] | None, outputs_size: int, bavg: float, stddev: float, precision: deepmd.tf.env.tf.DType, trainable: bool, initial_variables: dict | None, seed: int | None, uniform_seed: bool, name: str) tuple[deepmd.tf.env.tf.Variable, deepmd.tf.env.tf.Variable][source]#
deepmd.tf.nvnmd.utils.network.one_layer_t(shape: list[int] | None, outputs_size: int, bavg: float, stddev: float, precision: deepmd.tf.env.tf.DType, trainable: bool, initial_variables: dict | None, seed: int | None, uniform_seed: bool, name: str) deepmd.tf.env.tf.Variable[source]#
deepmd.tf.nvnmd.utils.network.one_layer(inputs: deepmd.tf.env.tf.Tensor, outputs_size: int, activation_fn: Callable | None = tf.nn.tanh, precision: deepmd.tf.env.tf.DType = GLOBAL_TF_FLOAT_PRECISION, stddev: float = 1.0, bavg: float = 0.0, name: str = 'linear', reuse: bool | None = None, seed: int | None = None, use_timestep: bool = False, trainable: bool = True, useBN: bool = False, uniform_seed: bool = False, initial_variables: dict | None = None, mixed_prec: dict | None = None, final_layer: bool = False) deepmd.tf.env.tf.Tensor[source]#

Build one layer with continuous or quantized value. Its weight and bias can be initialed with random or constant value.