Reader small image

You're reading from  Generative Adversarial Networks Projects

Product typeBook
Published inJan 2019
Reading LevelIntermediate
PublisherPackt
ISBN-139781789136678
Edition1st Edition
Languages
Right arrow
Author (1)
Kailash Ahirwar
Kailash Ahirwar
author image
Kailash Ahirwar

Kailash Ahirwar is a machine learning and deep learning enthusiast. He has worked in many areas of Artificial Intelligence (AI), ranging from natural language processing and computer vision to generative modeling using GANs. He is a co-founder and CTO of Mate Labs. He uses GANs to build different models, such as turning paintings into photos and controlling deep image synthesis with texture patches. He is super optimistic about AGI and believes that AI is going to be the workhorse of human evolution.
Read more about Kailash Ahirwar

Right arrow

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.

Loading the samples

To train...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Generative Adversarial Networks Projects
Published in: Jan 2019Publisher: PacktISBN-13: 9781789136678

Author (1)

author image
Kailash Ahirwar

Kailash Ahirwar is a machine learning and deep learning enthusiast. He has worked in many areas of Artificial Intelligence (AI), ranging from natural language processing and computer vision to generative modeling using GANs. He is a co-founder and CTO of Mate Labs. He uses GANs to build different models, such as turning paintings into photos and controlling deep image synthesis with texture patches. He is super optimistic about AGI and believes that AI is going to be the workhorse of human evolution.
Read more about Kailash Ahirwar