Skip to content

Fix inverted probability logic in RandomExpand.__call__#476

Open
pantment wants to merge 1 commit intoroboflow:developfrom
pantment:fix/random-expand-prob
Open

Fix inverted probability logic in RandomExpand.__call__#476
pantment wants to merge 1 commit intoroboflow:developfrom
pantment:fix/random-expand-prob

Conversation

@pantment
Copy link

This PR fixes a bug in RandomExpand.call where the probability check was inverted.
According to the docstring, prob is the probability to expand, but the previous implementation expanded with probability 1 - prob.
The condition has been corrected so that expansion now happens with the intended probability.

@CLAassistant
Copy link

CLAassistant commented Nov 29, 2025

CLA assistant check
All committers have signed the CLA.

Copy link
Contributor

Copilot AI left a comment

Choose a reason for hiding this comment

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

Pull request overview

This PR fixes a critical bug in the RandomExpand transform where the probability check was inverted, causing the transform to expand images with probability 1 - prob instead of the intended prob as documented in the docstring.

Changes:

  • Corrected the probability condition in RandomExpand.__call__ from < self.prob to >= self.prob for the early return

💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@Borda Borda added the bug Something isn't working label Jan 22, 2026
@Borda Borda requested a review from isaacrob as a code owner February 11, 2026 15:57
@Borda Borda force-pushed the develop branch 4 times, most recently from 60b16c1 to 523f9df Compare February 14, 2026 06:46
@Borda
Copy link
Member

Borda commented Feb 18, 2026

@pantment, it seems I cannot resolve the collision for you...

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

bug Something isn't working has conflicts

Projects

None yet

Development

Successfully merging this pull request may close these issues.

3 participants

Comments