Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Merge 0.5.0 changes to master #279

Merged
merged 73 commits into from
Jan 29, 2021
Merged
Changes from 2 commits
Commits
Show all changes
73 commits
Select commit Hold shift + click to select a range
fa32338
currObj should be updated as the closest from all candidated.
orrorcol Jun 27, 2020
b6b338e
1. Replace the template interface searchKnn with virtual interface
orrorcol Jun 27, 2020
8987188
minor fix
orrorcol Jun 27, 2020
a35fcb5
Adding cassert include in header to fix compilation error on Ubuntu 1…
Jul 9, 2020
4a4689c
Small patch to enable compilation with sign_compare and reorder warni…
Jul 9, 2020
40f31da
Merge pull request #231 from jwimberley/cassert_beaver_gcc730_fix
yurymalkov Jul 14, 2020
ab012ae
Merge pull request #233 from jwimberley/gcc_warning_fixes
yurymalkov Jul 15, 2020
6f2c3fb
L2SqrI: add fallback if the dimension is not a multiple of 4
fabiencastan Aug 19, 2020
21b54fe
Merge pull request #243 from alicevision/dev/l2sqrI4x
yurymalkov Aug 31, 2020
cb7b398
New methods loadIndexFromStream and saveIndexToStream expose de-/seri…
dbespalov Oct 12, 2020
e161db8
Implement __getstate__ and __setstate__ to allow pickling of hnswlib.…
dbespalov Oct 12, 2020
e0eacad
Verify knn_query results match before/after pickling hnswlib.Index ob…
dbespalov Oct 12, 2020
ec4f4b1
add documeentation
dbespalov Oct 12, 2020
a3646cc
clean-up readme
dbespalov Oct 12, 2020
a1ba4e5
clean-up readme
dbespalov Oct 12, 2020
cf3846c
clean-up readme
dbespalov Oct 12, 2020
27471cd
clean-up readme
dbespalov Oct 12, 2020
4220956
Update bindings_test_pickle.py
dbespalov Oct 12, 2020
72b6501
Revert "New methods loadIndexFromStream and saveIndexToStream expose …
Oct 23, 2020
3a62b41
use python's buffer protocol to avoid making copies of ann data (stat…
Oct 23, 2020
fe6d2fa
replace tab characters with spaces
Oct 23, 2020
c9fb60d
test each space (ip/cosine/l2) as a separate unittest
Oct 23, 2020
3c4510d
return array_t pointers
dbespalov Oct 25, 2020
64c5154
expose static method of Index class as copy constructor in python
dbespalov Oct 25, 2020
7b445c8
do not waste space when returning serialized appr_alg->linkLists_
dbespalov Oct 25, 2020
c02f1dc
serialize element_lookup_ and element_level_ as array_t arrays; pass …
dbespalov Oct 26, 2020
1f25102
warn that serialization is not thread safe with add_items
dbespalov Nov 3, 2020
1165370
warn that serialization is not thread safe with add_items; add todo b…
dbespalov Nov 3, 2020
2c040e6
remove camel casing
dbespalov Nov 3, 2020
6298996
add static const int data member to class Index that stores serializa…
dbespalov Nov 6, 2020
c8276d8
add todo block to convert parameter tuple to dicts
dbespalov Nov 6, 2020
345f71d
add todo block to convert parameter tuple to dicts
dbespalov Nov 6, 2020
a64a001
Fixes of some typos in readme
dyashuni Nov 6, 2020
cee0e99
Merge pull request #251 from dbespalov/python_bindings_pickle_io
yurymalkov Nov 9, 2020
1c97b5d
Merge pull request #253 from dyashuni/patch-1
yurymalkov Nov 9, 2020
ec38db1
Rename space_name to space on the python side
Nov 18, 2020
a0c2076
Add gitignore file to ignore build folders
Nov 18, 2020
8cc442d
Merge pull request #255 from dyashuni/develop
yurymalkov Nov 22, 2020
ded26fc
use dict for Index serialization
dbespalov Nov 23, 2020
e845d8a
debugging; have to wrap state dict into a tuple
dbespalov Nov 25, 2020
6425deb
Move setup.py into root folder to fix bindings build when symlink doe…
Nov 28, 2020
376c8cd
Update gitignore
Nov 28, 2020
68a8a36
Update Makefile to clean tmp folder
Nov 28, 2020
19abf9b
Update readme
Nov 28, 2020
2799aab
clean assert error message
dbespalov Nov 30, 2020
4c002bc
fix compilation error on osx
dbespalov Nov 30, 2020
5b2585d
Revert symlink to hnswlib and add windows to build matrix
Dec 1, 2020
dda9b31
Fix symlink
Dec 1, 2020
b1994a5
Update travis
Dec 1, 2020
afd18d2
Update travis
Dec 1, 2020
334cc6c
Merge pull request #258 from dbespalov/python_bindings_state_dict
yurymalkov Dec 1, 2020
b4b7b86
Merge pull request #224 from uestc-lfs/fix-update-ep
yurymalkov Dec 7, 2020
6efa48c
Add symlink to setup.py instead of hnswlib
Dec 8, 2020
4cf279b
Merge remote-tracking branch 'upstream/develop' into fix-interface
orrorcol Dec 10, 2020
9fe639d
fix interface
orrorcol Dec 12, 2020
21c1ad7
minor fix
orrorcol Dec 13, 2020
52da3d2
Merge pull request #225 from uestc-lfs/fix-interface
yurymalkov Dec 14, 2020
21b908f
Update README.md
js1010 Jan 4, 2021
d2e5a18
Update README.md
js1010 Jan 4, 2021
6449e64
Merge pull request #273 from js1010/patch-2
yurymalkov Jan 5, 2021
6ae02a5
Run sift test from separate directory
Jan 6, 2021
6d3b29f
Merge pull request #260 from dyashuni/develop
yurymalkov Jan 7, 2021
68b6257
PEP-517 support
groodt Jan 10, 2021
e94c5dc
Simplify include_dirs
groodt Jan 10, 2021
467c98f
Remove deprecated `setup.py test`
groodt Jan 13, 2021
2248ab4
pybind11 isn't needed at runtime, only build time
groodt Jan 13, 2021
8fe02c0
Support for packaging sdist
groodt Jan 15, 2021
73134a7
https git clone in README
groodt Jan 15, 2021
a9153e9
Add license file to pypi package
Jan 16, 2021
65a5f28
Merge pull request #274 from groodt/groodt-pyproject-toml
yurymalkov Jan 17, 2021
215526c
Merge pull request #276 from dyashuni/develop
yurymalkov Jan 17, 2021
1469702
bump version
yurymalkov Jan 25, 2021
e03162b
Merge pull request #278 from nmslib/upd0.5
yurymalkov Jan 25, 2021
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
10 changes: 5 additions & 5 deletions hnswlib/hnswalg.h
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ namespace hnswlib {
}

HierarchicalNSW(SpaceInterface<dist_t> *s, size_t max_elements, size_t M = 16, size_t ef_construction = 200, size_t random_seed = 100) :
link_list_locks_(max_elements), element_levels_(max_elements), link_list_update_locks_(max_update_element_locks) {
link_list_locks_(max_elements), link_list_update_locks_(max_update_element_locks), element_levels_(max_elements) {
max_elements_ = max_elements;

has_deletions_=false;
Expand Down Expand Up @@ -869,12 +869,12 @@ namespace hnswlib {
// continue;

std::priority_queue<std::pair<dist_t, tableint>, std::vector<std::pair<dist_t, tableint>>, CompareByFirst> candidates;
int size = sCand.find(neigh) == sCand.end() ? sCand.size() : sCand.size() - 1;
int elementsToKeep = std::min(int(ef_construction_), size);
size_t size = sCand.find(neigh) == sCand.end() ? sCand.size() : sCand.size() - 1; // sCand guaranteed to have size >= 1
size_t elementsToKeep = std::min(ef_construction_, size);
for (auto&& cand : sCand) {
if (cand == neigh)
continue;

dist_t distance = fstdistfunc_(getDataByInternalId(neigh), getDataByInternalId(cand), dist_func_param_);
if (candidates.size() < elementsToKeep) {
candidates.emplace(distance, cand);
Expand All @@ -893,7 +893,7 @@ namespace hnswlib {
std::unique_lock <std::mutex> lock(link_list_locks_[neigh]);
linklistsizeint *ll_cur;
ll_cur = get_linklist_at_level(neigh, layer);
int candSize = candidates.size();
size_t candSize = candidates.size();
setListCount(ll_cur, candSize);
tableint *data = (tableint *) (ll_cur + 1);
for (size_t idx = 0; idx < candSize; idx++) {
Expand Down