deepmd.tf.nvnmd.utils.network#
Attributes#
Functions#
| |
| Quantized matmul operation for 2d tensor. |
| Quantized matmul operation for 3d tensor. |
| Quantize and floor tensor x with quantification precision nbit. |
| Quantize and round tensor x with quantification precision nbit. |
| |
| |
| |
| Build one layer with continuous or quantized value. |
Module Contents#
- 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.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.