Skip to content

Fix/random interval #744

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

Merged
merged 6 commits into from
Jun 26, 2025
Merged

Fix/random interval #744

merged 6 commits into from
Jun 26, 2025

Conversation

laggui
Copy link
Member

@laggui laggui commented Jun 23, 2025

to_probability(int_random) produces a closed interval [0, 1], which was incorrect.

For uniform, u32::MAX should not map to 1 (range should be [0, 1)).
For normal, both ends should be open (0, 1).

See linked burn PR tracel-ai/burn#3321

  • Added to_unit_interval_closed_open and to_unit_interval_open instead of to_probability
    • Added unit tests with basic kernel to test the low/high value mappings

Validate your PR with burn.

It is important that you make sure that you don't introduce any bugs in burn.

Instructions

  • Create a new branch or fork of the burn repo
  • Update the main Cargo.toml with this PR hash.
  • Fix any broken tests or compilation errors in burn.
  •  Submit a PR in burn with your fixes and link it here.

@laggui laggui force-pushed the fix/random-interval branch from 69a3fe7 to e9298c1 Compare June 23, 2025 18:14
@laggui laggui marked this pull request as ready for review June 25, 2025 15:59
@laggui laggui mentioned this pull request Jun 25, 2025
1 task
@nathanielsimard nathanielsimard merged commit 602981d into main Jun 26, 2025
5 checks passed
@nathanielsimard nathanielsimard deleted the fix/random-interval branch June 26, 2025 14:19
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