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

Sampler - fix probability logic #130

Merged
merged 2 commits into from
Aug 28, 2024
Merged

Sampler - fix probability logic #130

merged 2 commits into from
Aug 28, 2024

Conversation

bmansoob
Copy link
Contributor

There was a bug in how Kernel.rand got passed to every function.

One of the first things we check:

return false if random > config.sample_rate

If the sample_rate is something like 0.001 then only lower probabilities options (mode, backend) will be chosen (because random was created once and passed down).

Fixed it by calling Kernel.rand every time.

Copy link
Member

@dalehamel dalehamel left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Makes sense - didn't realize in the prior review we were inadvertently filtering the rands that got passed down

@bmansoob bmansoob merged commit c10c43c into main Aug 28, 2024
7 checks passed
@bmansoob bmansoob deleted the fix-probabilties-logic branch August 28, 2024 17:17
@bmansoob bmansoob mentioned this pull request Aug 28, 2024
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.

2 participants