-
Notifications
You must be signed in to change notification settings - Fork 226
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
[Feature] Implement of sngan_proj #42
Conversation
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
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.
Further comments
Codecov Report
@@ Coverage Diff @@
## master #42 +/- ##
==========================================
+ Coverage 73.78% 75.15% +1.36%
==========================================
Files 113 117 +4
Lines 7080 7457 +377
Branches 1272 1358 +86
==========================================
+ Hits 5224 5604 +380
+ Misses 1516 1454 -62
- Partials 340 399 +59
Flags with carried forward coverage won't be shown. Click here to find out more.
Continue to review full report at Codecov.
|
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
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.
Comments for the generator
and discriminator
.
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
auto_sync_bn=True, | ||
with_spectral_norm=False, | ||
norm_eps=1e-4, | ||
style='BigGAN'): |
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.
This style is only for initialization. Thus, I may recommend using init_cfg=dict(style='BigGAN')
.
mmgen/models/architectures/sngan_proj/generator_discriminator.py
Outdated
Show resolved
Hide resolved
layer. Defaults to ``dict(type='ReLU')``. | ||
with_spectral_norm (bool, optional): Whether use spectral norm for | ||
all conv blocks or not. Default to True. | ||
style (string, optional): Behavior and initialization style of the |
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.
Refer to the generator
.
out = out + torch.sum(w_y * h, dim=1, keepdim=True) | ||
return out.view(out.size(0), -1) | ||
|
||
def init_weights(self, pretrained=None, strict=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.
Refer to the comments in generator
conv_cfg=None, | ||
with_spectral_norm=False, | ||
norm_eps=1e-4, | ||
style='BigGAN'): |
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.
init_cfg=dict(styel='BigGAN')
may be better.
if self.use_cbn: | ||
weight = self.weight_embedding(y)[:, :, None, None] | ||
bias = self.bias_embedding(y)[:, :, None, None] | ||
if self.style == 'BigGAN': |
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.
Here, I may suggest using the original reweight_embedding
. You just need to specify why we need this trick in comments.
Unit-test should be further added for more coverage rate. |
* init of sngan * fix bug in version 1 * add default_args to build_module * refine the implementation * refine code + add unit test * fix typo * remove inplace relu * fix bug in weight init * add unit test + fix bug in models * fix bug in unit test
No description provided.