tf.keras.quantizers.TernaryQuantizationConfig

Ternary quantization config.

Inherits From: QuantizationConfig

Quantizes weights to {-1, 0, +1} (BitNet b1.58) and stores them at the information-theoretic floor of log2(3) ~= 1.58 bits/value by packing five trits per byte. The quantization rule (threshold and scale) is owned by the layer, so this config takes no quantizer arguments.

mode

Methods

activation_quantizer_or_default

View source

from_config

View source

get_config

View source

weight_quantizer_or_default

View source