-
Notifications
You must be signed in to change notification settings - Fork 409
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
Unknown term in sample_permutation
for sinkhorn
#1063
Comments
The choice of In #L62, After sampling, in #L63, the sampled points are sorted and then multiplied by If you're dealing with batch sizes larger than |
Could you please cite the source? This otherwise feels like an AI-generated answer. |
Computational View : For increased numerical stability, the Sinkhorn algorithm is reformulated in the log-domain. By sampling permutations, you essentially reduce the size of the matrices involved, making the computation more tractable while still obtaining a reasonable approximation of the optimal transport plan. Instead of considering all possible permutations, which can be prohibitively expensive, you randomly select a subset of permutations to compute, providing a good approximation of the solution with reduced computational cost. References : You can have a read at Jasper Snoeck work from Google Brain to get a more detailed understanding of the working of the Sinkhorn algorithms and its applications in Optimal Transport problems. Mathematical View : Convex Relaxations for Permutation Problems |
Hi, I am trying to use
sinkhorn
matcher for batch sizes >8 (per device) as in the code. It (understandably) fails at #L62 sincebs * dim
exceeds sampling range available10 * dim
.ValueError: Cannot take a larger sample than population when 'replace=False'
scenic/scenic/model_lib/matchers/sinkhorn.py
Lines 62 to 63 in 1dc7352
I could replace 10 with
bs
or higher to get it to work. I have few questions though:10
arbitrary?10
multiplied to the sorted vector in #L63? Could you point me to the relevant literature (incl for previous) if this is a specific choice?10
is arbitrary, can I replace10 -> bs
in both #L62 and #L63 while maintaining algorithmic correctness?The text was updated successfully, but these errors were encountered: