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
docment GAN #72
docment GAN #72
Conversation
Check out this pull request on See visual diffs & provide feedback on Jupyter Notebooks. Powered by ReviewNB |
This PR would finish #20. |
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.
As we discussed on discord, added suggestions for one of the methods style issues. If you could fix the highlighted formatting issues from basic_generator
in other methods, everything looks pretty good.
Finished the changes based on @warner-benjamin's and @muellerzr's suggestions. I will note this very weird issue we discussed on Discord voice channel. In the code there is the following function:
I have added some docmenting but not type annotations. However, once I specifically add a type annotation to size, the full notebook doesn't run without error anymore:
What happens is that This is a little concerning if code breaks due to the type annotations, so as a side note, we should all be making sure the tests pass for all of these PRs (must be enabled for first-time contributors). |
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.
Noticed one formatting error. Made a couple suggestions to make the doc strings more concise. Please replicate those in the other doc strings. Also, I think the loss_crit
doc string had an error, but am not 100% sure.
Co-authored-by: Benjamin Warner <me@benjaminwarner.dev>
Co-authored-by: Benjamin Warner <me@benjaminwarner.dev>
Co-authored-by: Benjamin Warner <me@benjaminwarner.dev>
…int into docment_gan
@warner-benjamin updated, let me know if there's anything else that needs to be updated... |
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.
I don't think we need to add a None type hint for args with a default of None. I provided an example.
Remove the None type hints and it looks good.
@@ -121,23 +160,33 @@ def forward(self, output, target): | |||
|
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.
Add types to AdaptiveLoss
@@ -259,7 +316,12 @@ class InvisibleTensor(TensorBase): | |||
def show(self, ctx=None, **kwargs): return ctx |
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.
Maybe add doc string to explain InvisibleTensor
. What is Invisible about it?
fastai/vision/gan.py
Outdated
switch_eval:bool=False, # Whether the model should be set to eval mode when calculating loss | ||
**kwargs | ||
): | ||
"Create a WGAN from `dls`, `generator` and `critic`." |
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.
What is a WGAN? Is there a paper link or anything for this
One other thought, maybe the model training should be behind a nbdev |
Co-authored-by: Kevin Bird <kevinbird15@gmail.com>
Co-authored-by: Kevin Bird <kevinbird15@gmail.com>
Co-authored-by: Kevin Bird <kevinbird15@gmail.com>
Co-authored-by: Kevin Bird <kevinbird15@gmail.com>
Co-authored-by: Kevin Bird <kevinbird15@gmail.com>
There is an |
Alright. Resolve the CI errors and then it looks good to me. |
@warner-benjamin updated... |
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
Okay here's my first docment PR, let me know if there are any issues and I would appreciate any feedback you have.
I'll note I did take out the
after_epoch
andshow_img
arguments since they weren't doing anything. I will take a little time to debug and get them working. Shall I make an issue in the main fastai repo? I can work on fixing that after the docment sprint.