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

Unknown term in sample_permutation for sinkhorn #1063

Open
MasterSkepticista opened this issue May 13, 2024 · 1 comment
Open

Unknown term in sample_permutation for sinkhorn #1063

MasterSkepticista opened this issue May 13, 2024 · 1 comment

Comments

@MasterSkepticista
Copy link

MasterSkepticista commented May 13, 2024

Hi, I am trying to use sinkhorn matcher for batch sizes >8 (per device) as in the code. It (understandably) fails at #L62 since bs * dim exceeds sampling range available 10 * dim.

ValueError: Cannot take a larger sample than population when 'replace=False'

v = jax.random.choice(key, 10 * dim, shape=(bs, dim), replace=False)
v = jnp.sort(v, axis=-1) * 10.

I could replace 10 with bs or higher to get it to work. I have few questions though:

  • Is 10 arbitrary?
  • Why is 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?
  • If 10 is arbitrary, can I replace 10 -> bs in both #L62 and #L63 while maintaining algorithmic correctness?
@MasterSkepticista
Copy link
Author

Could you please cite the source? This otherwise feels like an AI-generated answer.

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

1 participant