Training and Testing The Discriminator

Learn to train the discriminator, visualize training, and then test the discriminator.

It is a good idea to test important elements of any machine learning architecture. Here we’ll test the discriminator.

We haven’t yet built the generator so we can’t really test the discriminator as it must compete with the generator. What we can do is to check that the discriminator can separate real data from random data.

That might not sound like a useful test, but it is. It tells us that the discriminator has the capacity to at least separate real data from random noise. If it can’t do that, then it is unlikely to be able to do the harder task of separating real data from the fake data that looks like real data. So this test will catch any discriminator which was unlikely to ever be good at competing with the generator.

Let’s create a function to generate random noise patterns.

Get hands-on with 1400+ tech skills courses.