Settings for simulated quantization of the tpu embedding table.
View aliases
Compat aliases for migration
See Migration guide for more details.
tf.tpu.experimental.embedding.QuantizationConfig(
num_buckets: int, lower: float, upper: float
)
When simulated quantization is enabled, the results of the embedding lookup are clipped and quantized according to the settings here before the combiner is applied.
For example, to quantize input
the following is done:
if input < lower
input = lower
if input > upper
input = upper
quantum = (upper - lower) / (num_buckets - 1)
input = math.floor((input - lower) / quantum + 0.5) * quantium + lower
See tensorflow/core/protobuf/tpu/optimization_parameters.proto for more details.