Advertisement
Guest User

Untitled

a guest
Jan 13th, 2016
109
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 1.20 KB | None | 0 0
  1. Ilya@ilyaraz-laptop ~/FALCONN
  2. $ python
  3. Python 3.4.3 (default, May 5 2015, 17:58:45)
  4. [GCC 4.9.2] on cygwin
  5. Type "help", "copyright", "credits" or "license" for more information.
  6. >>> import falconn
  7. >>> p = falconn.get_default_parameters(1000000, 128, is_sufficiently_random=True)
  8. >>> p
  9. <Swig Object of type 'falconn::python::LSHConstructionParameters *' at 0x6ffffd3a298>
  10. >>> p.k
  11. 3
  12. >>> t = falconn.LSHIndex(p)
  13. >>> import numpy as np
  14. >>> dataset = np.random.randn(1000000, 128).astype(np.float32)
  15. >>> t.fit(dataset)
  16. >>> t.find_nearest_neighbor(np.random.randn(128))
  17. Traceback (most recent call last):
  18. File "<stdin>", line 1, in <module>
  19. File "/home/Ilya/FALCONN/env/lib/python3.4/site-packages/FALCONN-1.1-py3.4-cygwin-2.3.1-x86_64.egg/falconn/__init__.py", line 284, in find_nearest_neighbor
  20. self._check_query(query)
  21. File "/home/Ilya/FALCONN/env/lib/python3.4/site-packages/FALCONN-1.1-py3.4-cygwin-2.3.1-x86_64.egg/falconn/__init__.py", line 248, in _check_query
  22. raise ValueError('dataset and query must have the same dtype')
  23. ValueError: dataset and query must have the same dtype
  24. >>> t.find_nearest_neighbor(np.random.randn(128).astype(np.float32))
  25. Segmentation fault (core dumped)
  26. (env)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement