You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
147027: vecindex: fix bugs and clean up r=drewkimball a=andy-kimball
#### quantize: fix calculation when vectors are added incrementally
The quantization code is mis-calculating the centroid dot product when
vectors are added incrementally to a quantized set that uses a non-Euclidean
distance metric. Rather than appending the dot products to the end of the
CentroidDotProducts slice, it was overwriting the initial elements of the
slice. Fix the bug and add more tests that ensure it won't happen again.
#### kmeans: fix small issue with convergence calculation
Update the convergence calculation to match the logic in scikit-learn, which
sums the shifts across all centroids before comparing to the tolerance value.
Also improve comments and add an interesting test case.
#### quantize: remove the QuantizedVectorSet.GetCentroid method
Remove GetCentroid method from the QuantizedVectorSet interface. Having
it present on the interface forces every quantizer to store it, even
those (like UnQuantizer) that don't need it. It's also redundant in most
contexts with Partition.Centroid(), so it's cleaner to have code use
that consistently.
Co-authored-by: Andrew Kimball <[email protected]>
0 commit comments