In the SimGAN paper, the authors provided a convenient graphic for users to base their development on. We already know that we need to develop models for each of the networks, but how do we train a network in the first place? The following diagram offers an explanation:
Algorithm
Let's convert the preceding diagram into the following, tangible steps:
- Read both synthetic images and real images into variables.
- Then, for every epoch, do the following:
- Train the refiner networks on a random mini batch for K_G times
- Train the discriminator network on a random mini batch for K_D times
- Stop when the number of epochs reached, or lost, has not changed significantly for n epochs.