Skip to content
This repository has been archived by the owner on Feb 22, 2020. It is now read-only.

Commit

Permalink
fix(encoder): fix vald encocer
Browse files Browse the repository at this point in the history
  • Loading branch information
Larryjianfeng committed Sep 9, 2019
1 parent ffc822b commit 814b2ee
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions gnes/encoder/numeric/vlad.py
Original file line number Diff line number Diff line change
Expand Up @@ -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)
Expand Down

0 comments on commit 814b2ee

Please sign in to comment.