Skip to content

Expand prototype transforms consistency tests to most random tests #6522

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 5 commits into from
Aug 30, 2022

Conversation

pmeier
Copy link
Collaborator

@pmeier pmeier commented Aug 30, 2022

Follow-up to #6516. Fortunately, we didn't touch the random parameter generation during porting and so setting the random seed if sufficient for most transformations. The only ones left are the AA transforms, for which @vfdev-5 is adding checks in #6519.

Apart from the tests, this PR also fixes some bugs in RandomAffine, RandomPerspective, and GaussianBlur.

@@ -389,7 +389,7 @@ def _get_params(self, sample: Any) -> Dict[str, Any]:
shear_y = float(torch.empty(1).uniform_(self.shear[2], self.shear[3]).item())

shear = (shear_x, shear_y)
return dict(angle=angle, translations=translations, scale=scale, shear=shear)
return dict(angle=angle, translate=translate, scale=scale, shear=shear)
Copy link
Collaborator

Choose a reason for hiding this comment

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

Nice catch! Seems like I just copied the name from stable RandomAffine.get_params but unfortunately previous tests didn't revealed that.

Copy link
Collaborator

@vfdev-5 vfdev-5 left a comment

Choose a reason for hiding this comment

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

Thanks @pmeier, lgtm!

@pmeier pmeier merged commit 000f84d into pytorch:main Aug 30, 2022
@pmeier pmeier deleted the proto-transform-consistency branch August 30, 2022 20:33
facebook-github-bot pushed a commit that referenced this pull request Sep 9, 2022
… tests (#6522)

Summary:
* add checks for pure random apply transformations

* add tests for some non-deterministic transforms used in classification reference

* add consistency checks for most transforms

* fix RandomAffine, RandomPerspective, and GaussianBlur

* fix tests

Reviewed By: YosuaMichael

Differential Revision: D39381959

fbshipit-source-id: 8b574a1e52027fccfc079da7b7691890c560c900
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants