-
Notifications
You must be signed in to change notification settings - Fork 323
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
Add Pix2Pix model #533
Add Pix2Pix model #533
Conversation
Codecov Report
@@ Coverage Diff @@
## master #533 +/- ##
==========================================
- Coverage 77.58% 76.51% -1.08%
==========================================
Files 115 117 +2
Lines 6701 6829 +128
==========================================
+ Hits 5199 5225 +26
- Misses 1502 1604 +102
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
Hello @aniketmaurya! Thanks for updating this PR. There are currently no PEP 8 issues detected in this Pull Request. Cheers! 🍻 Comment last updated at 2021-02-24 21:04:04 UTC |
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 had glance of it, let me know what you think.
Very nice PR, Pix2Pix is really useful model.
|
||
def __init__(self, input_channels, use_dropout=False, use_bn=True): | ||
super(self).__init__() | ||
self.upsample = nn.Upsample(scale_factor=2, mode='bilinear', align_corners=True) |
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.
Let's just confirm once if Upsample is done using nn.Upsample
or nn.ConvTranspose2d
both work fine. I haven't read Pix2Pix paper so let me check once.
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.
Hi, thank you for the review. In section 6 of the Pix2Pix paper authors have mentioned that they upsampled the tensors by a factor of 2 but they haven't exactly mentioned if Transposed Conv is used or Upsample followed by Conv layer.
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 quickly checked the paper and found that the PyTorch implementation linked from the author's Lua implementation uses nn.ConvTranspose2d
, so shall we follow that architecture unless someone has a strong opinion?
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.
Yes I too confirmed that it is nn.ConvTranspose2d
. I have referred TensorFlow docs, which give a really nice implementation.
Co-authored-by: Aditya Oke <[email protected]>
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.
Thank you for your work! Could you have a look at my nitpicking comments? 😅
Hi, I have added the training step code to the PR. Also I have tried to train the model using Facades dataset. Please help in review the PR. |
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.
@aniketmaurya Would you mind merging master and applying yapf to pass the failing tests?
|
||
def __init__(self, input_channels, use_dropout=False, use_bn=True): | ||
super(self).__init__() | ||
self.upsample = nn.Upsample(scale_factor=2, mode='bilinear', align_corners=True) |
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 quickly checked the paper and found that the PyTorch implementation linked from the author's Lua implementation uses nn.ConvTranspose2d
, so shall we follow that architecture unless someone has a strong opinion?
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'm bit unsure about some aspects of implementation.
This colab notebook gives a really simple and effective Pix2Pix.
|
||
def __init__(self, input_channels, use_dropout=False, use_bn=True): | ||
super(self).__init__() | ||
self.upsample = nn.Upsample(scale_factor=2, mode='bilinear', align_corners=True) |
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.
Yes I too confirmed that it is nn.ConvTranspose2d
. I have referred TensorFlow docs, which give a really nice implementation.
GANs are notorius 😅 Small differences such as LeakyRelu vs Relu, Dropout probability, ConvTranspose vs Upsampling really make difference. Really tough time in getting a GAN trained, really great job @aniketmaurya @akihironitta I would suggest to use torchvision, it is well tested and a standard (over 15Million downloads). |
@oke-aditya I agree, thanks for your 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.
Hey @aniketmaurya, it'd be great to have this model in Bolts!!! Please mark this PR as ready for review when you're ready :)
What does this PR do?
Fixes #512
Before submitting
PR review
Anyone in the community is free to review the PR once the tests have passed.
If we didn't discuss your PR in Github issues there's a high chance it will not be merged.
Did you have fun?
Make sure you had fun coding 🙃