Skip to content
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

Fix warnings during GAN training #3334

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

AndreyYashkin
Copy link

This issue is described in #3222

According to Callback documentation "Callbacks provide a shortcut to avoid having to write self.learn.bla for any bla attribute we seek; instead, just write self.bla. This only works for getting attributes, not for setting them."

@review-notebook-app
Copy link

Check out this pull request on  ReviewNB

See visual diffs & provide feedback on Jupyter Notebooks.


Powered by ReviewNB

Copy link
Member

@jph00 jph00 left a comment

Choose a reason for hiding this comment

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

Instead of changing things to store in the Learner, let's instead rename to avoid name conflicts. I suggest adding a gan_ prefix as shown. You'll also need to update the usages of these names throughout the class to add the prefix. Many thanks for your PR!

@@ -148,8 +148,8 @@ def _set_trainable(self):

def before_fit(self):
"Initialize smootheners."
self.generator,self.critic = self.model.generator,self.model.critic
self.gen_mode = self.gen_first
self.learn.generator,self.learn.critic = self.model.generator,self.model.critic
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
self.learn.generator,self.learn.critic = self.model.generator,self.model.critic
self.gan_generator,self.gan_critic = self.model.generator,self.model.critic

self.generator,self.critic = self.model.generator,self.model.critic
self.gen_mode = self.gen_first
self.learn.generator,self.learn.critic = self.model.generator,self.model.critic
self.learn.gen_mode = self.gen_first
Copy link
Member

Choose a reason for hiding this comment

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

Suggested change
self.learn.gen_mode = self.gen_first
self.gan_gen_mode = self.gen_first

@AndreyYashkin AndreyYashkin requested a review from jph00 May 14, 2021 17:57
@AndreyYashkin
Copy link
Author

My apologies for the late reply. I was too busy last weeks and could not find free time to update and check my patch.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

3 participants