MCPcopy Create free account
hub / github.com/dblalock/bolt / encode_X

Method encode_X

experiments/python/main.py:270–278  ·  view source on GitHub ↗
(self, X, **sink)

Source from the content-addressed store, hash-verified

268 return lut
269
270 def encode_X(self, X, **sink):
271 if self.algo == 'OPQ':
272 X = pq.opq_rotate(X, self.R)
273 elif self.algo == 'Bolt':
274 X = pq.bopq_rotate(X, self.rotations)
275
276 idxs = pq._encode_X_pq(X, codebooks=self.centroids)
277
278 return idxs + self.offsets # offsets let us index into raveled dists
279
280 def fit_query(self, q, quantize=True, **sink):
281 quantize = quantize and self.quantize_lut

Callers

nothing calls this directly

Calls

no outgoing calls

Tested by

no test coverage detected