lecture 7: generative adversarial networks

32
Lecture 7: Generative Adversarial Networks 1

Upload: others

Post on 07-Feb-2022

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Lecture 7: Generative Adversarial Networks

Lecture 7: Generative Adversarial Networks

1

Page 2: Lecture 7: Generative Adversarial Networks

Start Recording!

2

Page 3: Lecture 7: Generative Adversarial Networks

Reminders

3

● Office Hours tomorrow (11-12h)

● Talks this Friday. Read the papers ○ https://arxiv.org/abs/1703.10593

○ https://arxiv.org/pdf/1606.00709.pdf

● Time to start to seriously think about your project (if not done yet).

● Deadline for the extended abstract around March 12th.

Ask Questions on the papers on TEAMS!

Page 4: Lecture 7: Generative Adversarial Networks

1. Goodfellow, Ian J., Jean Pouget-Abadie, Mehdi Mirza, Bing Xu, David Warde-Farley, Sherjil Ozair, Aaron Courville, and Yoshua Bengio. "Generative adversarial networks." NeurIPS (2014).

2. Radford, Alec, Luke Metz, and Soumith Chintala. "Unsupervised representation learning with deep convolutional generative adversarial networks." ICLR (2016).

References related to this course:

4

Page 5: Lecture 7: Generative Adversarial Networks

Goal: Given an input x, predict and output y

Supervised Learning

What we have: Observations:

Examples: ● Input: Images, sound, text, video.● Output: Labels (prediction), real response (regression).

5

Page 6: Lecture 7: Generative Adversarial Networks

Goal: Given an input x, predict and output y

Supervised Learning

What we have: Observations:

Examples: ● Input: Images, sound, text, video.● Output: Labels (prediction), real response (regression).

Source: Descript software

[Sagawa et al. 2020] 6

Page 7: Lecture 7: Generative Adversarial Networks

Unsupervised Learning

Goal: ????

What we have: Observations:

Examples: ● Input: Images, sound, text, video.● Output: NONE!

7

Page 8: Lecture 7: Generative Adversarial Networks

Unsupervised Learning

Goal: Clustering, Dimensionality reduction, Feature learning, Density estimation.

What we have: Observations:

Examples: ● Input: Images, sound, text, video.● Output: NONE!

High level: Understand the “world” from data.

Main body of the CAKE!!!!

8

Page 9: Lecture 7: Generative Adversarial Networks

Generative Modeling

● Unsupervised learning.

● Goal: Estimate the data distribution. Find 𝜃 such that

Source: scikit-learn.org

● Standard technique: Maximum Likelihood Estimation

● Statisticians love it. ● Suffers from curse of dimensionality

9

Page 10: Lecture 7: Generative Adversarial Networks

● Let us assume we have: (example from [Theis et al. 2016])

Large Log-Likelihood but Poor Samples

Very “good” Very “bad” (e.g. noise)

● But very high log-likelihood:

“Bad” samples 99% of the time

Scale with d!! (≅ 100 for CIFAR) ≅ 4.61 10

Page 11: Lecture 7: Generative Adversarial Networks

● Let us assume we have: (example from [Theis et al. 2016])

Large Log-Likelihood and Great Samples

Very “good” Very “bad” Good

● But very high log-likelihood:

“Bad” Good samples ≅100% of the time

Scale with d!! ≅ 4.61 11

Page 12: Lecture 7: Generative Adversarial Networks

● Let us assume we have: (example from [Theis et al. 2016])

Large Log-Likelihood

Very “good” Very “bad” Good

● But very high log-likelihood:

“Bad” Good samples 99% of the time

Scale with d!! ≅ 4.61

Conclusion: ● First case: nonrealistic samples 99% of the time.

● Second case: realistic samples ≅100% of the time.

● In both case when d large log-likelihoods (LL) are very similar.

For instance for CIFAR-10 two generative models may have variations in LL to the order of ≅ 100 !!! [van den Oord & Dambre, 2015]

12

Page 13: Lecture 7: Generative Adversarial Networks

● Let us assume we have memorized the train set: (from [Theis et al. 2016])

● Our density:

Poor LL and Great Looking Samples

Negative Log-likelihood

on the test data.

or

Infinite! Goes to Infinity with δ !

13

Page 14: Lecture 7: Generative Adversarial Networks

● Unsupervised learning (we can learn meaningful latent features)

Why Generative Modeling?

[Donahue et al. 2017]

14

Page 15: Lecture 7: Generative Adversarial Networks

Why Generative Modeling?

[Yang et al. 2020]

● Super-resolution.

15

Page 16: Lecture 7: Generative Adversarial Networks

Taxonomy of Generative Models

16[Goodfellow 2016]

Page 17: Lecture 7: Generative Adversarial Networks

● Variational AutoEncoder [Kingma et al. 2013]

● Pixel RNN [van den Oord et al. 2016], Pixel CNN [van den Oord et al. 2016]

The main Deep Generative Models

Best Paper Award ICML 2016

● Generative Adversarial Networks. (Today)

For VAE you can check the Deep Learning book

This course will only cover GANS

17

Page 18: Lecture 7: Generative Adversarial Networks

From Bayes’ rule:

Standard Technique Using Explicit Density

18

Problem: ● O(d) generation cost. (slow)● Not clear what the order we want to set for the variables. ● No latent space. (no features extractions)

Page 19: Lecture 7: Generative Adversarial Networks

Idea: Transform an easy to sample distribution into something else:

Implicit distribution

19

Usually GaussianChallenging to compute but easy

to sample from

Page 20: Lecture 7: Generative Adversarial Networks

GANsFake Data

True Data

GeneratorNoise

DiscriminatorFakeorReal

[Goodfellow et al. NIPS 2014]

20

Page 21: Lecture 7: Generative Adversarial Networks

GANs

21

Given p_g, binary classification with cross-entropy:

Depends on G!!!

For a fixed Generator, the Discriminator wants to:

Page 22: Lecture 7: Generative Adversarial Networks

GANs

22

● Game!!!

D wants to maximize that while G want to minimize it

Page 23: Lecture 7: Generative Adversarial Networks

GANs

23

Questions: (not easy) 1. Does this game have a pure Nash Equilibrium? (under which assumption)

2. Do we have a simple formula for the Nash?

Page 24: Lecture 7: Generative Adversarial Networks

● Exactly memorizing the train set is optimal for the Generator.

Question: Why it does not happen?

GAN: a Trivial Game?

24

Fake Data

True Data

GeneratorNoise

DiscriminatorFakeorReal

[Goodfellow et al. NIPS 2014]

Page 25: Lecture 7: Generative Adversarial Networks

A different loss of each player:

Non-Zero Sum Game

25

V.sSupposed to give stronger Gradient early in learning

Page 26: Lecture 7: Generative Adversarial Networks

A different loss of each player:

Non-Zero Sum Game

26

V.sSupposed to give stronger Gradient early in learning

Question: What is the Equilibrium of this new Game?

Page 27: Lecture 7: Generative Adversarial Networks

Issues with GAN Training

27

Page 28: Lecture 7: Generative Adversarial Networks

● Idea: condition the generator AND the discriminator with labels. [Mirza et al. 2014]

Conditional GANs

28

Page 29: Lecture 7: Generative Adversarial Networks

https://phillipi.github.io/pix2pix/ [Isola et al 2017]

Conditional GANs

● Can condition on anything:(as long as we have data)

29

Page 30: Lecture 7: Generative Adversarial Networks

● Initial idea from Radford et al [2016]

Arithmetic in the Latent Space

Arithmetic in latent space

Arithmetic in pixel space

30

Page 31: Lecture 7: Generative Adversarial Networks

https://github.com/ajbrock/Neural-Photo-Editor (2016)

Arithmetic in the Latent Space

31

Page 32: Lecture 7: Generative Adversarial Networks

Arithmetic in the Latent SpaceIdea: learn the “latent directions” of these features(Age, Eyeglasses, Gender, pose).

https://genforce.github.io/interfacegan/ (2020)32