mmagic.models.editors.dcgan.dcgan_discriminator
¶
Module Contents¶
Classes¶
Discriminator for DCGAN. |
- class mmagic.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, init_cfg=None)[source]¶
Bases:
mmengine.model.BaseModule
Discriminator 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.
- Parameters
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
.init_cfg (dict, optional) – Initialization config dict. Default: None.