Advertisement
Guest User

Untitled

a guest
Jan 13th, 2016
67
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 0.37 KB | None | 0 0
  1. import falconn
  2. import numpy as np
  3.  
  4. def test_lsh_index_positive():
  5. n = 1000
  6. d = 128
  7. p = falconn.get_default_parameters(n, d)
  8. t = falconn.LSHIndex(p)
  9. dataset = np.random.randn(n, d).astype(np.float32)
  10. t.fit(dataset)
  11. u = np.random.randn(d).astype(np.float32)
  12. t.find_k_nearest_neighbors(u, 10)
  13.  
  14. if __name__ == '__main__':
  15. test_lsh_index_positive()
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement