-
Notifications
You must be signed in to change notification settings - Fork 446
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
Enable to use input_size at transforms in recipe #3759
Enable to use input_size at transforms in recipe #3759
Conversation
a1f8726
to
77fbb0f
Compare
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Quite nice feature for recipe users or developers.
Generally looks good, but it might be controversial if it's "too much".
Left minor comments from a code reader's viewpoint. Feel free to ignore.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Thanks for your hard work. :)
I left some comments, please take a look.
And I think this PR has to include updated recipes to check unit and integration tests that are affected by this change.
What do you think?
Summary
This PR enables to use input_size at transforms in recipe.
It's for unified input size. So, if value of all init_args in recipe uses input_size, all necessary values are automatically updated by changing only input_size.
For example, let's assume that we have recipe as below.
It can be changed as below using input_size.
As you can see above,
$(input_size)
should be used to notify to use input_size.Only simple multiplication or division evaluation is supported. So, addition or subtraction can't be used.
Type of input_size can be
int
ortuple[int, int]
. Ifint
value is given, it's considered astuple[int, int]
with same value.whether passing
int
ortuple[int, int]
to transform class is decided based on type hint. If there is no type hint,tuple[int, int]
is passed.input_size can be overrided by subset config. For example, if we want to use (1000, 1000) input size at train and (800, 800) at validation, recipe below can be used.
Of course, setting input_size only in subset confg rather than data config is available.
But input_size can't use
$(input_size)
. It's available only intransforms
.How to test
Checklist
License
Feel free to contact the maintainers if that's a concern.