We have already covered the training objective function in the An Introduction to CycleGANs section. We have also created the respective Keras models for both networks. Training the CycleGAN is a multi-step process. We will perform the following steps to train the network:
- Loading the dataset
- Creating the generator and the discriminator networks
- Training the network for a specified number of epochs
- Plotting the losses
- Generating new images
Let's define the essential variables before starting to train the network, as follows:
data_dir = "/Path/to/dataset/directory/*.*"
batch_size = 1
epochs = 500