Skip to content
Permalink
Browse files

fix(encoder): fix vald encocer

  • Loading branch information...
Larryjianfeng committed Sep 9, 2019
1 parent ffc822b commit 814b2ee6a8d2cf8c3b436c02c15176ca227233dc
Showing with 2 additions and 2 deletions.
  1. +2 −2 gnes/encoder/numeric/vlad.py
@@ -47,8 +47,8 @@ def faiss_index(self):

def kmeans_pred(self, vecs):
if self.using_faiss_pred:
D, I = self.index_flat.search(vecs.astype(np.float32), 1)
return np.reshape(I, [-1])
_, pred = self.index_flat.search(vecs.astype(np.float32), 1)
return np.reshape(pred, [-1])
else:
vecs = np.reshape(vecs, [vecs.shape[0], 1, 1, vecs.shape[1]])
dist = np.sum(np.square(vecs - self.centroids), -1)

0 comments on commit 814b2ee

Please sign in to comment.
You can’t perform that action at this time.