mmagic.models.editors.lsgan.lsgan_discriminator
¶
Module Contents¶
Classes¶
Discriminator for LSGAN. |
- class mmagic.models.editors.lsgan.lsgan_discriminator.LSGANDiscriminator(input_scale=128, output_scale=8, out_channels=1, in_channels=3, base_channels=64, conv_cfg=dict(type='Conv2d'), default_norm_cfg=dict(type='BN'), default_act_cfg=dict(type='LeakyReLU', negative_slope=0.2), out_act_cfg=None, init_cfg=None)[source]¶
Bases:
mmengine.model.BaseModule
Discriminator for LSGAN.
Implementation Details for LSGAN 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;
Use fully connected layer in the output layer;
Use 5x5 conv rather than 4x4 conv in DCGAN.
- Parameters
input_scale (int, optional) – The scale of the input image. Defaults to 128.
output_scale (int, optional) – The final scale of the convolutional feature. Defaults to 8.
out_channels (int, optional) – The channel number of the final output layer. Defaults to 1.
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.
conv_cfg (dict, optional) – Config for the convolution module used in this discriminator. Defaults to dict(type=’Conv2d’).
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='LeakyReLU', negative_slope=0.2)
.out_act_cfg (dict, optional) – Activation config for the final output layer. Defaults to
dict(type='Tanh')
.init_cfg (dict, optional) – Initialization config dict.