Discussion: October 17th
Deadline (optional): October 16th, 18:00
This “first” assignment is intended as a refresher on Deep Learning models as well as a first look at why we might need generative models by considering how other models fail at modeling data distributions properly. Use this as an opportunity to set up training/experimentation workflows that you can reuse in later assignments. Please read the first section carefully for information on submissions etc.
This assignment does not need to be handed in. However, if you struggle with the contents of part 1, particularly building and training a simple autoencoder, you likely do not fulfill the prerequisites for this class.
Assignments will generally consist of writing code, usually to implement some kind of generative model and to apply it/experiment with it a little. If something is unclear, or you run into trouble, ask. Do not spend all week doing nothing! Ask questions on Mattermost in a public channel since other people might have the same question (or be able to provide an answer)!
Programming must be done in Python 3.x and Pytorch.
Code should be your own. In the event that you take parts of code from elsewhere, clearly indicate this and provide a source. Do not copy-paste complete tutorials from elsewhere as your submission. Do not take code from other groups. Plagiarism is not permitted!
The previous point also holds for AI-generated code! It is faculty policy that you must clearly indicate if you used AI, for which parts, and why. Submissions suspected of unreported AI usage may be penalized. In any case, your submission must contain a substantial contribution by yourself. Submitting fully AI-generated code is a waste of everyone’s time.
Tasks are often deliberately open-ended in order to encourage exploration. Don’t concern yourself with achieving X% of points. These assignments are for you to gain practical experience and to get into the habit of asking (and answering) interesting questions.
We should be able to provide GPU access on our compute server, which gives you significantly more flexibility compared to Google Colab or other cloud providers.
For each assignment, your final results should be in a Jupyter notebook. Use images/plots liberally. Also, use markdown cells to write text to explain or discuss your code/results. Make sure that your notebooks include outputs. We should not have to run your notebooks to confirm that your code works correctly.
Submissions are handled via Moodle. Upload your file(s) before the deadline. Regular submission is obligatory to be admitted to the exam. Like in the IDL class, you have to submit all assignments (excluding the usual things like medical reasons, emergencies etc).
Assignments can be worked on in groups (up to 3-4 people). All members must be able to present the solution if asked to do so. Coordinate with your group members to join the same group on E-Learning. Please do not join other people’s groups without asking! Note: Contrary to the IDL class, you don’t have to join a group by yourself if you want to work alone.
The deadline is generally on Thursday evening (6pm).
We have previously gotten to know autoencoders. Since these consist of an encoder and a decoder, they could in principle be used to generate data through use of the decoder on its own. Try this:
Are you happy with the outputs? You most likely aren’t. Offer some hypotheses as to why this might be. Think about and propose (and, if you want to, implement) ways to produce better codes/images.
When training a model in part 1, you likely used an “off-the-shelf” loss function such as binary cross-entropy or mean squared error. In this section, we will take a step back and think about deriving loss functions based on prior considerations. This relies on concepts discussed in the first week’s exercise.
p(x|z) where x is the data and
z the latent code.
We will ignore the encoder for now.
theta.
Reframe the decoder neural network as outputting those parameters.
Now, we have expressedp(x|z) via p(x|theta) with theta = decoder(z).theta as the output of the decoder, backpropagation automatically trains the network parameters such that the
distribution parameters theta are optimized given our loss.To set some expectations, using a Gaussian distribution with fixed variance should give you the squared error as a loss function; using a Bernoulli distribution should result in the binary cross-entropy.