GENERATIVE ADVERSARIAL NETWORKS - Deep...

25
GENERATIVE ADVERSARIAL NETWORKS 11785- Introduction to Deep Learning AKSHAT GUPTA KUSHAL SAHARAN

Transcript of GENERATIVE ADVERSARIAL NETWORKS - Deep...

Page 1: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

GENERATIVE ADVERSARIAL NETWORKS

11785- Introduction to Deep Learning

AKSHAT GUPTAKUSHAL SAHARAN

Page 2: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

–Yann LeCun

“This (GANS), and the variations that are now being proposed is the most interesting idea in the last 10

years in ML, in my opinion”

Page 3: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

Video: https://www.youtube.com/watch?v=QiiSAvKJIHo

Page 4: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

WHAT ARE GANS?

Generative Adversarial Networks

Page 5: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

WHAT ARE GANS?

Generative Adversarial Networks

Generative ModelsWe try to learn the underlying the distribution

from which our dataset comes from.Eg: Variational AutoEncoders (VAE)

Page 6: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

WHAT ARE GANS?

Generative Adversarial Networks

Generative ModelsWe try to learn the underlying the distribution

from which our dataset comes from.Eg: Variational AutoEncoders (VAE)

Encoderx ~ (training set) P(z) Decoder

Page 7: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

WHAT ARE GANS?

Generative Adversarial Networks

Generative ModelsWe try to learn the underlying the distribution

from which our dataset comes from.Eg: Variational AutoEncoders (VAE)

Adversarial TrainingGANS are made up of two competing networks (adversaries)

that are trying beat each other.

Page 8: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

WHAT ARE GANS?

Generative Adversarial Networks

Generative ModelsWe try to learn the underlying the distribution

from which our dataset comes from.Eg: Variational AutoEncoders (VAE)

Adversarial TrainingGANS are made up of two competing networks (adversaries)

that are trying beat each other.

Neural Networks

Page 9: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

WHAT ARE GANS?

P(z) Generator Generated Data

Page 10: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

WHAT ARE GANS?

P(z) Generator Generated Data

Discriminator Real/Fake?

Page 11: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

WHAT ARE GANS?

P(z) Generator Generated Data

Discriminator Real/Fake?

RealData

Page 12: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

HOW TO TRAIN A GAN?

Page 13: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

HOW TO TRAIN A GAN?At t = 0,

GeneratorLatent Vector

GeneratedImage (fake image)

Generated Data

Discriminator Real/Fake?

GivenTraining

Data

(fake data)

(Real data)

Page 14: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

HOW TO TRAIN A GAN?At t = 0,

GeneratorLatent Vector

GeneratedImage (fake image)

Generated Data

Discriminator Real/Fake?

GivenTraining

Data

(fake data)

(Real data)

BinaryClassifier

Page 15: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

HOW TO TRAIN A GAN?Which network should I train first?

Page 16: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

HOW TO TRAIN A GAN?Which network should I train first?

Discriminator!

Page 17: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

HOW TO TRAIN A GAN?

Which network should I train first?Discriminator!

But with what training data?

Page 18: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

HOW TO TRAIN A GAN?

Which network should I train first?Discriminator!

But with what training data?The Discriminator is a Binary classifier.The Discriminator has two class - Real and Fake.The data for Real class if already given: THE TRAINING DATAThe data for Fake class? -> generate from the Generator

Page 19: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

HOW TO TRAIN A GAN?What’s next? -> Train the Generator

But how? What’s our training objective?

Page 20: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

HOW TO TRAIN A GAN?What’s next? -> Train the Generator

But how? What’s our training objective?Generate images from the Generator

such that they are classified incorrectly by the Discriminator!

Page 21: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

HOW TO TRAIN A GAN?

Discriminator

Step 1:Train the Discriminator using the current ability

of the Generator.

Page 22: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

HOW TO TRAIN A GAN?

GeneratorDiscriminator

Step 1:Train the Discriminator using the current ability

of the Generator.

Step 2:Train the Generator

to beatthe Discriminator.

Page 23: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

HOW TO TRAIN A GAN?

GeneratorDiscriminator

Step 1:Train the Discriminator using the current ability

of the Generator.

Step 2:Train the Generator

to beatthe Discriminator.

Generate images from the Generator such that they are classified incorrectly by the Discriminator!

Page 24: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

HOW TO TRAIN A GAN?

GeneratorDiscriminator

Step 1:Train the Discriminator using the current ability

of the Generator.

Step 2:Train the Generator

to beatthe Discriminator.

Page 25: GENERATIVE ADVERSARIAL NETWORKS - Deep Learningdeeplearning.cs.cmu.edu/F20/document/recitation/GANS-ppt.pdf · 2021. 3. 22. · Generative Adversarial Networks Generative Models We

MNIST AND FASHION-MNIST