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 bad fakes
From the course: AI Workshop: Hands-on with GANs with Deep Convolutional Networks
Training a discriminator on bad fakes
We have the discriminator set up, now it's time to train it. The loss function that we'll use is the BCELoss or the Binary Cross Entropy loss. The BCELoss is a loss function that measures the difference between two probability distributions. In the context of binary classification, the two probability distributions are the predicted probabilities of the positive class and the negative class, as compared with the actual labels in the data. Next, we use the Adam optimizer to train the discriminator. The Adam optimizer has an adaptive learning rate that has been shown to work well for a GAN. We're only training the discriminator, but we are using the same optimizer and the same parameters like we would for the discriminator when it's part of a GAN. Next, let's set up a training loop to train our classification model. Now we'll train just for two epochs. You can see the for loop for epochs on line 1. We only train for two epochs because that's more than sufficient for the discriminator to…
Practice while you learn with exercise files
Download the files the instructor uses to teach the course. Follow along and learn by watching, listening and practicing.
Contents
-
-
-
-
Types of convolutional layers4m 11s
-
(Locked)
Training data for discriminator bad fakes and real images4m 34s
-
(Locked)
Loading and transforming training image data4m 55s
-
(Locked)
Understanding the discriminator architecture7m 8s
-
(Locked)
Training a discriminator on bad fakes5m 58s
-
(Locked)
Training data for discriminator good fakes and real images3m 8s
-
(Locked)
Training a discriminator on good fakes4m 56s
-
-
-