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

feat: improve sampling algorithm robustness #923

Merged
merged 6 commits into from
Mar 9, 2025
Merged

Conversation

yzh119
Copy link
Collaborator

@yzh119 yzh119 commented Mar 9, 2025

  1. add a parameter indices to sampling APIs to allow multiple samples from the same probability distribution.
  2. address the abnormal case of sum(probs) < u, where our earlier implementation might return an impossible value.
  3. add unittest for comparing the sampled result distribution (with a lot of trials) and original distribution.

@yzh119
Copy link
Collaborator Author

yzh119 commented Mar 9, 2025

@merrymercy does the unittests look good for you?

@yzh119 yzh119 merged commit fb578e7 into main Mar 9, 2025
@yzh119 yzh119 requested a review from Copilot March 9, 2025 22:11
@MasterJH5574 MasterJH5574 deleted the fix-sampling-abnormal branch March 13, 2025 14:09
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

Successfully merging this pull request may close these issues.

1 participant