-
Notifications
You must be signed in to change notification settings - Fork 160
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
True lambda #1
Comments
@oguiza |
@oguiza
The codes will be updated, thanks! |
We updated Close issue. |
There is a potential bug in the cutmix code when applying the lambda value to the target.
Initially you randomly define a lambda value that you use in the rand_bbox to define bbx1, bby1, bbx2, bby2. But when the coordinates of the selected region fall close to an image edge, the values are clipped. That's ok to define the image region (doing so all image pixels have the same probability of being selected). However, the true lambda (proportion of the image that is mixed) is smaller than the previously defined lambda.
To avoid this the true lambda value that should be applied to the target should be calculated this way:
lam = 1 - ((bbx2 - bbx1) * (bby2 - bby1) / (input.size()[-1] * input.size()[-2]))
This value would now be correctly, and can be applied to the target thus avoiding unnecessary distortions.
The text was updated successfully, but these errors were encountered: