What VectorQuantizer returns.
Attributes
quantizedTensorThe quantised field, same shape as the input. Numerically equal
to the selected codebook entries, but differentiable with respect
to the input via the straight-through estimator.
indicesTensorSelected entry per position — the input's shape with the trailing
feature axis dropped,
int64 dtype.codebook_lossTensorScalar , which trains the
codebook and is detached from the input.
commitment_lossTensorScalar , which trains the
input's producer and is detached from the codebook. Reported
unweighted — apply
commitment_cost when summing the terms.perplexityTensorScalar over the batch's usage
histogram, in
[1, num_embeddings]. A value falling toward 1
means the codebook is collapsing to a few live entries.