Skip to content

Linear transformation #1813

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

Closed

Conversation

ghosalsattam
Copy link
Contributor

This PR is aimed at Linear Transformation of images.

Copy link
Member

@WindQAQ WindQAQ left a comment

Choose a reason for hiding this comment

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

Thanks for contribution! I would think this is not a necessary function. Besides the function calls about shape (to_4D_image, from_4D_image, etc) and casting, it is just an one line wrapper of a * image + b.

Also, when doing testing, we should make the tolerance atol and rtol as small as possible. In this case, 0.006 might be too large in my opinion.

It is really helpful that we can open an issue to talk about why we need it, why we should include this function before creating an PR.

Thanks.

cc @tensorflow/sig-addons-maintainers

@ghosalsattam
Copy link
Contributor Author

ghosalsattam commented May 11, 2020

@WindQAQ I can modify this function if required.
The negative operation and identity operation(#1333 #1353 ) are special cases of the linear transformation. Besides this PR with slight modification can address the shifting of grayscale value from one range to other.
And what can be acceptable tollerance value?

@WindQAQ
Copy link
Member

WindQAQ commented May 11, 2020

@WindQAQ I can modify this function if required.
The negative operation and identity operation(#1333 #1353 ) are special cases of the linear transformation. Besides this PR with slight modification can address the shifting of grayscale value from one range to other.

So maybe we should discuss more about this kind of single-lined wrapper. Personally, I discourage the single-lined wrapper because it adds more testing codes than "real" source codes.

@gabrieldemarmiesse @seanpmorgan @Squadrick @bhack Hi, thoughts on this?

And what can be acceptable tollerance value?

Just leave the argument default.

However, for example, if you are trying to test against scipy's implementation, we might want to make tolerance larger because the underlying implementation of scipy uses double aka float64 to compute, which produces more precise results. In this case, we can adjust the tolerance to acceptable value say 1e-6 or 1e-5 etc.

@bhack
Copy link
Contributor

bhack commented May 11, 2020

For output = a * image + b we need to maintain 107 lines of code in the repo.

@gabrieldemarmiesse
Copy link
Member

We really need to clean up #1333 and #1353, those issues were made without inspecting too much the list of said transformations or how it was phrased, and now contributors are being confused about why we need those and what form it should take. We are wasting contributors' time and that's not good. I'll try to take a look at it tomorrow and cleanup / clarify those issues. Apologies @ghosalsattam we should have been more careful about the issues and what was said in them. We need those transformations for randaugment and autoaugment, but we don't need to expose all of them with a public API.

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.

5 participants