-
Notifications
You must be signed in to change notification settings - Fork 3.6k
clarify Trainer running state atribs. #5589
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
Conversation
tchaton
left a comment
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.
LGTM ! Can you add it for tuning, evaluating ?
done, in fact as the new API stays, I moved it to Trainer |
|
Well not sure why these three tests are failing, any suggestion? @awaelchli |
Codecov Report
@@ Coverage Diff @@
## release/1.2-dev #5589 +/- ##
===============================================
- Coverage 93% 92% -0%
===============================================
Files 153 153
Lines 10815 10834 +19
===============================================
- Hits 10006 10005 -1
- Misses 809 829 +20 |
|
I don't like the |
Ok, so what else do you suggest? |
@is_testing.setter
def is_testing(self, value: bool):
if value:
self._running_stage = RunningStage.TESTING |
Yes, that is standard setter, but with this one is unclear what it does if you pass something else then true/1 |
tchaton
left a comment
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.
LGTM !
|
You did not explain in the PR description what the motivation behind this renaming is. It is not clear to me why it is necessary. When no issue is linked it would be very helpful to do that as some reviewers were not part of offline discussions. |
|
ok, so @awaelchli suggests keeping it as attributes, correct? |
|
I guess my main concern was just that you are introducing two names, is_testing and set_testing, while in python we do not often see this kind of getter and setter naming. the convention is to have the same name for the setter and getter (typically). Please correct me if I'm wrong. It's not a strong opinion, but I see some benefits having closer naming to pytorch :) |
|
@awaelchli I gree that introducing new attributes is not a good way :] @tchaton @PyTorchLightning/core-contributors what is your point of view? |
|
so far I have not experienced or seen complaints about confusion between model and trainer attributes. But this is mainly because nn.Module only has a .training attribute (no testing) and on the other hand our Trainer has only a .testing attribute and no training. So, it could be seen as confusing from different perspectives 😆 |
ok, I have reverted the rename and just moved the properties to the trainer as they won't be deprecated |
tchaton
left a comment
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.
LGTM !
What does this PR do?
moving attributes to the main class as they won't be deprecated
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
Before you start reviewing make sure you have read Review guidelines. In short, see the following bullet-list:
Did you have fun?
Make sure you had fun coding 🙃