Assignment 6/7: GANs

Discussion: June 3rd
Deadline: June 2nd, 23:59
No exercise on May 27th!

Guess what, we’re doing GANs this time.

Note: For this assignment and in general, you can upload more than one notebook if you find this better, e.g. to avoid overly long notebooks with a loooong string of pretty much independent experiments.

Basic Setup

Implementing the basic GAN logic isn’t too difficult. You will likely want to use low-level training loops (i.e. GradientTape) because of the non-trvial control flow. There are many examples around the web that can help you get started (but note that many are outdated, e.g. using TF 1.x). For example, there is a DCGAN guide on the TF website.

This should be enough for a functional training procedure. Train some models and generate samples for evaluation. They will most likely be terrible.

Take note: Evaluating whether GAN training is progressing/”working” is difficult. The loss values are not very informative. You will want to take some samples and plot them every so often while training is progressing to get an impression of the current state. However, even this can be misleading: You might run into mode collapse problems early on, which you can take as evidence that training is not working, and stop the process early. However, it could actually happen that the mode collapse “magically” gets fixed over the course of a few training iterations, and diverse samples are produced. For this reason, consider always training for a large number of steps (larger than e.g. VAEs) and just see what happens.

Improving GAN training

GANs are notoriously difficult to train. In the rest of this assignment, you are asked to try out various ways to improve the basic procedure. There are countless advanced GAN variants, but for now you may focus on “tricks” to make the original formulation more stable. Here are some leads:

Include as many of these methods as you want/need into your model and try to achieve some nice samples!

Part 2: Advanced GAN Architectures

GANs have come a long way since their original inception in 2014, and discussing and/or implementing all significant improvements is not feasible. Below you can find some more leads for advanced architectures; implement at least one of these, experiment with the associated parameters and compare with your previous implementation. In principle you can also mix and match these methods with each other or the improvements from part 1. Some of these mixes might work well, others not at all…