mmedit.models.editors.dcgan.dcgan_discriminator¶
Module Contents¶
Classes¶
Discriminator for DCGAN. |
- class mmedit.models.editors.dcgan.dcgan_discriminator.DCGANDiscriminator(input_scale, output_scale, out_channels, in_channels=3, base_channels=128, default_norm_cfg=dict(type='BN'), default_act_cfg=dict(type='LeakyReLU'), out_act_cfg=None, pretrained=None)[源代码]¶
Bases:
torch.nn.ModuleDiscriminator for DCGAN.
Implementation Details for DCGAN architecture:
Adopt convolution in the discriminator;
Use batchnorm in the discriminator except for the input and final output layer;
Use LeakyReLU in the discriminator in addition to the output layer.
- 参数
input_scale (int) – The scale of the input image.
output_scale (int) – The final scale of the convolutional feature.
out_channels (int) – The channel number of the final output layer.
in_channels (int, optional) – The channel number of the input image. Defaults to 3.
base_channels (int, optional) – The basic channel number of the generator. The other layers contains channels based on this number. Defaults to 128.
default_norm_cfg (dict, optional) – Norm config for all of layers except for the final output layer. Defaults to
dict(type='BN').default_act_cfg (dict, optional) – Activation config for all of layers except for the final output layer. Defaults to
dict(type='ReLU').out_act_cfg (dict, optional) – Activation config for the final output layer. Defaults to
dict(type='Tanh').pretrained (str, optional) – Path for the pretrained model. Default to
None.