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

ConvBlock for Discriminator #168

Open
Rainyryan opened this issue Nov 17, 2023 · 0 comments
Open

ConvBlock for Discriminator #168

Rainyryan opened this issue Nov 17, 2023 · 0 comments

Comments

@Rainyryan
Copy link

Rainyryan commented Nov 17, 2023

In the original paper Upsample is done prior to the convolutions in the Generator, while Downsample is done after the convolutions within the ConvBlock.

I believe the following changes should be appropriate.

I discovered large discrepancies when checking the number of parameters for each layer in D and G. Unlike in the paper where D and G have same number of parameters.

class ConvBlock(nn.Module):
    def __init__(self, in_channels, out_channels, use_pixelnorm=True, isgen=True):
        super(ConvBlock, self).__init__()
        self.use_pn = use_pixelnorm
        self.conv1 = WSConv2d(
            in_channels, out_channels if isgen else in_channels) <<<<<<<<
        self.conv2 = WSConv2d(
            out_channels if isgen else in_channels, out_channels)<<<<<<<<
        self.leaky = nn.LeakyReLU(0.2)
        self.pn = PixelNorm()
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant