Again, training a DCGAN is similar to training a Vanilla GAN network. It is a four-step process:
- Load the dataset.
- Build and compile the networks.
- Train the discriminator network.
- Train the generator network.
We will work on these steps one by one in this section.
Let's start by defining the variables and the hyperparameters:
dataset_dir = "/Path/to/dataset/directory/*.*"
batch_size = 128
z_shape = 100
epochs = 10000
dis_learning_rate = 0.0005
gen_learning_rate = 0.0005
dis_momentum = 0.9
gen_momentum = 0.9
dis_nesterov = True
gen_nesterov = True
Here, we have specified different hyperparameters for the training. We will now see how to load the dataset for the training.