Advertisement
Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- Ilya@ilyaraz-laptop ~/FALCONN
- $ python
- Python 3.4.3 (default, May 5 2015, 17:58:45)
- [GCC 4.9.2] on cygwin
- Type "help", "copyright", "credits" or "license" for more information.
- >>> import falconn
- >>> p = falconn.get_default_parameters(1000000, 128, is_sufficiently_random=True)
- >>> p
- <Swig Object of type 'falconn::python::LSHConstructionParameters *' at 0x6ffffd3a298>
- >>> p.k
- 3
- >>> t = falconn.LSHIndex(p)
- >>> import numpy as np
- >>> dataset = np.random.randn(1000000, 128).astype(np.float32)
- >>> t.fit(dataset)
- >>> t.find_nearest_neighbor(np.random.randn(128))
- Traceback (most recent call last):
- File "<stdin>", line 1, in <module>
- 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
- self._check_query(query)
- 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
- raise ValueError('dataset and query must have the same dtype')
- ValueError: dataset and query must have the same dtype
- >>> t.find_nearest_neighbor(np.random.randn(128).astype(np.float32))
- Segmentation fault (core dumped)
- (env)
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement