Training the DCGAN

Again, training a DCGAN is similar to training a Vanilla GAN network. It is a four-step process:

  1. Load the dataset.
  2. Build and compile the networks.
  3. Train the discriminator network.
  4. 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.

..................Content has been hidden....................

You can't read the all page of ebook, please click here login for view all page.
Reset
3.141.192.120