This PR introduces DCGAN architectures into deeplay. The models are implemented as described in the original DCGAN article (link).
Example:
Creating DCGAN generator
generator = dl.DcganGenerator(
latent_dim=100,
features_dim=64,
output_channels=1,
class_conditioned_model=False,
num_classes=10, # only used if class_conditioned_model=True
embedding_dim=100, # only used if class_conditioned_model=True
)
Creating DCGAN discriminator
discriminator = dl.DcganDiscriminator(
input_channels=1,
features_dim=64,
class_conditioned_model=False,
num_classes=10, # only used if class_conditioned_model=True
embedding_dim=100, # only used if class_conditioned_model=True
)
As DCGAN is a fixed architecture, the images need to be resized to 64 x 64 before passing through the models. The number of Conv blocks in discriminator and the ConvTranspose blocks in the generator are fixed to 4 as per the paper. However, the number of features in each block can be controlled by changing the features_dim attribute.
For generator, number of features in each ConvTranspose block goes as [features_dim*16, features_dim*8, features_dim*4, features_dim*2]
For discriminator, the number of features in each Conv block goes by [features_dim, features_dim*2, features_dim*4, features_dim*8].
By changing the features_dim parameter, the relative strength of generator and discriminator can be controlled.
This PR introduces DCGAN architectures into deeplay. The models are implemented as described in the original DCGAN article (link).
Example:
Creating DCGAN generator
Creating DCGAN discriminator
As DCGAN is a fixed architecture, the images need to be resized to
64 x 64
before passing through the models. The number of Conv blocks in discriminator and the ConvTranspose blocks in the generator are fixed to 4 as per the paper. However, the number of features in each block can be controlled by changing thefeatures_dim
attribute.For generator, number of features in each ConvTranspose block goes as
[features_dim*16, features_dim*8, features_dim*4, features_dim*2]
For discriminator, the number of features in each Conv block goes by
[features_dim, features_dim*2, features_dim*4, features_dim*8]
.By changing the
features_dim
parameter, the relative strength of generator and discriminator can be controlled.