-
Notifications
You must be signed in to change notification settings - Fork 448
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
1 parent
a95d3a4
commit f443b1f
Showing
61 changed files
with
16,558 additions
and
6 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,34 @@ | ||
API Reference | ||
============= | ||
|
||
nmslib.init | ||
----------- | ||
|
||
This function acts act the main entry point into NMS lib. This | ||
function should be called first before calling any other method. | ||
|
||
.. autofunction:: nmslib.init | ||
|
||
nmslib.FloatIndex | ||
----------------- | ||
|
||
nmslib.dist.FloatIndex | ||
|
||
.. autoclass:: nmslib.dist.FloatIndex | ||
:members: | ||
|
||
nmslib.DoubleIndex | ||
------------------ | ||
|
||
nmslib.dist.DoubleIndex | ||
|
||
.. autoclass:: nmslib.dist.DoubleIndex | ||
:members: | ||
|
||
nmslib.IntIndex | ||
--------------- | ||
|
||
nmslib.dist.IntIndex | ||
|
||
.. autoclass:: nmslib.dist.IntIndex | ||
:members: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,24 @@ | ||
.. nmslib documentation master file, created by | ||
sphinx-quickstart on Mon Aug 7 17:30:15 2017. | ||
You can adapt this file completely to your liking, but it should at least | ||
contain the root `toctree` directive. | ||
Non-Metric Space Library (NMSLIB) | ||
================================== | ||
|
||
Contents: | ||
|
||
.. toctree:: | ||
:maxdepth: 2 | ||
:caption: Contents: | ||
|
||
Quickstart <quickstart> | ||
API Reference <api> | ||
|
||
|
||
Indices and tables | ||
================== | ||
|
||
* :ref:`genindex` | ||
* :ref:`modindex` | ||
* :ref:`search` |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,39 @@ | ||
Python bindings for NMSLIB | ||
==================================== | ||
|
||
Installation | ||
------------ | ||
|
||
This project works with Python on version 2.7+ and 3.5+, and on Linux, OSX and the Windows operating systems. To install: | ||
|
||
``pip install nmslib`` | ||
|
||
You may need to install Python dev-files. On Ubuntu, you can do it as follows: | ||
|
||
``sudo apt-get install python3-dev`` | ||
|
||
Building on Windows requires Visual Studio 2015, see this project for more information. | ||
|
||
Example Usage | ||
------------- | ||
|
||
.. code-block:: python | ||
import nmslib | ||
import numpy | ||
# create a random matrix to index | ||
data = numpy.random.randn(10000, 100).astype(numpy.float32) | ||
# initialize a new index, using a HNSW index on Cosine Similarity | ||
index = nmslib.init(method='hnsw', space='cosinesimil') | ||
index.addDataPointBatch(data) | ||
index.createIndex({'post': 2}, print_progress=True) | ||
# query for the nearest neighbours of the first datapoint | ||
ids, distances = index.knnQuery(data[0], k=10) | ||
# get all nearest neighbours for all the datapoint | ||
# using a pool of 4 threads to compute | ||
neighbours = index.knnQueryBatch(data, k=10, num_threads=4) | ||
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.