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

can't find the right one using falconn v 1.3.1 #90

Open
SueeH opened this issue Nov 6, 2017 · 4 comments
Open

can't find the right one using falconn v 1.3.1 #90

SueeH opened this issue Nov 6, 2017 · 4 comments

Comments

@SueeH
Copy link

SueeH commented Nov 6, 2017

I built a hash table with about 20,000 data, feature dimension is 256, but when using find_k_nearest_neighbors ,it can't find the right one;
and when using [get_unique_candidates] , it may return 2000~4000 candidates, including the right one ;
still i search all the data one by one ,

the final result is same as get_unique_candidates.
For example
When using find_k_nearest_neighbors (in our case k =9) can not find the shortest distance FuMingming, and may return 9 candidates with distance 0.66~0.7; so the right one is missed;
while using get_unique_candidates or get_duplicate_candidates it can find the right one ;

example

Uploading example.jpg…

@ludwigschmidt
Copy link
Collaborator

Internally, find_k_nearest_neighbors relies on the methods for finding candidates. So in principle what you described shouldn't happen.

Just to clarify: what distance function are you using when you find the nearest neighbor yourself among the candidates returned by get_unique_candidates?

@SueeH
Copy link
Author

SueeH commented Nov 7, 2017

I use Euclidean distance,for two normalized vector v1 v2,||v1-v2|| is calculated .
Is any possible falconn v1.3.1 only find the local optimal value, rather than the global optimal value?

@ludwigschmidt
Copy link
Collaborator

FALCONN can certainly miss the nearest neighbor. But if the nearest neighbor appears in the candidate set, FALCONN should find it.

What distance function are you using when you set up the FALCONN data structure?

@SueeH
Copy link
Author

SueeH commented Nov 10, 2017

I used parameter as follows:
params_hp.dimension = vec_len_;
params_hp.lsh_family = LSHFamily::CrossPolytope;
params_hp.distance_function = DistanceFunction::EuclideanSquared;
params_hp.storage_hash_table = StorageHashTable::BitPackedFlatHashTable;
params_hp.k =2;
params_hp.l = 10;
params_hp.feature_hashing_dimension = 8;
params_hp.last_cp_dimension = 8;
params_hp.num_rotations = 3;
params_hp.num_setup_threads = 0;
params_hp.seed = seed ^ 833840234;
and set_num_probes(2464);

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants