From the course: AI Workshop: Hands-on with GANs with Deep Convolutional Networks

Unlock this course with a free trial

Join today to access over 23,300 courses taught by industry experts.

Training a discriminator on good fakes

Training a discriminator on good fakes

Next, we'll actually train the discriminator. And again, the parameters and the steps we follow are the same as in the previous demo. So I won't repeat the same information over and over again. Here is where we set up variables with the number of channels, the size of feature maps in the discriminator, and the learning rate for the optimizer. Next, we set up the function to initialize the weights of the discriminator based on the recommendation of the original DCGANs paper. Then, of course, we instantiate the class for the discriminator. This is the same discriminator network that we saw in the previous demo, and that we explored in a lot of detail, so I won't go through the explanations again. Notice that we have convolutional layers, batch normalization layers, and the LeakyReLU activation, and the last convolutional layer of the discriminator, of course, has the sigmoid activation. Now, after we've set up the discriminator, let's instantiate the discriminator and move it to the…

Contents