-
Notifications
You must be signed in to change notification settings - Fork 57
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
LocalMAP can cause an infinite loop #89
Comments
Thank you for your interest in our work! I suspect the problem is due to the mismatch between v0.7.4, which is the previous version we used in the work, versus v0.7.6 in the current main branch. We're actively investigating this issue. Since this issue is LocalMAP-specific, I've also created a mirror in the LocalMAP repo and we will post our further response there. |
We've done some investigation on this issue and we managed to reproduce this error on our machines.
|
I've tested on the latest master and LocalMAP now completes with all datasets I have tried. Many thanks for such fast work. Happy holidays. |
I have eagerly jumped on the opportunity to test out LocalMAP and to read the accompanying paper. Another very stimulating paper and congratulations to everyone involved.
I have managed to make LocalMAP with default parameters hang indefinitely on several datasets, including the
20NG
dataset provided in thedata
folder of this repo (among others, COIL-100 was also affected).Although I strongly doubt this bit matters, in the interest of full reproducibility, I grab the
.npy
file this way (after installinghttpx
):And then I am able to reliably (but not 100% of the time) cause LocalMAP to hang indefinitely like this:
I think the lack of complete reproducibility might be due to threading issues in the new LocalMAP routines: even when the run completes successfully, costs diverge after the first 200 iterations between runs using a fresh kernel and a fixed seed. I am using
numba 0.60.0
andpython 3.12.8
on WSL and the frequency of the hanging seems highly dependent on therandom_state
value.At any rate, the hanging occurs in
sample_FP_nearby
, and is almost certainly due to the logic here:PaCMAP/source/pacmap/pacmap.py
Lines 1129 to 1132 in 803b6cc
where an infinite loop will occur if none of the candidate distances exceed
low_dist_thres
. FWIW one solution would be to fillresult
with-1
, set thewhile
loop to terminate after a fixed number of iterations or failures, and thencontinue
in the FP loop inpacmap_grad_nearby_recip_sqrt
ifj == -1
. This fixes the problem for all the datasets I tried it on without affecting other datasets.The text was updated successfully, but these errors were encountered: