AI 로봇 아티스트의 비밀
Deep Generative Models
2019-05-23
Sung-Soo Kim
sungsoo@etri.re.kr
Smart Data Research Group
특강
Outline
! Introduction
– ArtificialIntelligence,MachineLearning,DeepLearning
! Autoencoders
! Variational Autoencoders (VAEs)
! Generative Adversarial Networks (GANs)
! Summary
Slide Credits
4
6.S191 Introduction to Deep Learning
Which face is fake?
AI Artist: Ai-Da
6
ArtificialIntelligence
MachineLearning
인공지능이란 무엇일까요?
인공지능을
단순화해서 생각해봅시다.
Dog
Cat
입력이 주어지면 출력을 내보낸다.
인공지능
입력이 주어지면, 출력을 내보낸다.
우리 이런 걸 어디서 봤죠?
함수 (Functions)
System, Filter
라고도 불립니다.
인공지능 별 거 아니죠?
무서울 것 없습니다.
근데 왜 갑자기 무서워 졌을까요?
모두의연구소
수학적으로 표현할 수 없었던
복잡한 인간의 두뇌를
데이터를 기반으로 흉내내다.
러닝(Learning) = 학습
Adaptation/Update
러닝(Learning) = 학습
Adaptation/Update
인공지능이 점점 똑똑해진다.
X[n]
F[n] F[n-1]
Y[n]
n : data index
Data가 늘어날수록
점점 인공지능 알고리즘이
학습(Learning)한다.
머신러닝의
세가지 타입
Supervised
Unsupervised Reinforcement
Learning
Classification
Regression
Clustering
3
X ???
6 Dog Cat
Supervised
Learning
- 정답이 주어진다.
- (비교적)문제풀이가 쉽다
3
X ???
???
Unsupervised
Learning
미지수 2개, 방정식 1개
풀 수 있나요?
Reinforcement
Learning
- (정답이 아닌) reward가 주어진다.
Reward
x
???
+10 / -10
Reinforcement
Learning
딥러닝을 이해하기 위해서는
인공신경망을 알아야 한다.
뉴런과
인공뉴런
x
1
x
1 b
a
다른 머신러닝
기법들과의 차이점 1:
Nonlinear(복잡한)
activation function
b
a
다층 레이어
(Multiple Layer)
다른 머신러닝
기법들과의 차이점 2 :
Nonlinear function의
Nonlinear function의
Nonlinear function …
엄청 복잡한 함수
(인공지능)을
만들 수 있다.
Hidden layer가 2개이상인 NN를
Deep Learning이라고 부른다.
머신러닝
(Machine Learning)
인공신경망
(Neural Network)
딥러닝
(Deep Learning)
딥러닝? 머신러닝?
26
6.S191 Introduction to Deep Learning
Supervised vs unsupervised learning
Supervised Learning
Data: (", $)
" is data, $ is label
Goal: Learn function to map
" → $
Examples: Classification,
regression, object detection,
semantic segmentation, etc.
Unsupervised Learning
Data: "
" is data, no labels!
Goal: Learn some hidden or
underlying structure of the data
Examples: Clustering, feature or
dimensionality reduction, etc.
27
6.S191 Introduction to Deep Learning
Supervised vs unsupervised learning
Supervised Learning
Data: (", $)
" is data, $ is label
Goal: Learn function to map
" → $
Examples: Classification,
regression, object detection,
semantic segmentation, etc.
Unsupervised Learning
Data: "
" is data, no labels!
Goal: Learn some hidden or
underlying structure of the data
Examples: Clustering, feature or
dimensionality reduction, etc.
28
6.S191 Introduction to Deep Learning
Generative modeling
Goal: Take as input training samples from some distribution
and learn a model that represents that distribution
Density Estimation Sample Generation
Input samples Generated samples
Training data ~ "#$%$ & Generated ~ "'(#)* &
How can we learn "'(#)* & similar to "#$%$ & ?
samples
KeyTakeaway#1 KeyTakeaway#2
MainTakeaways
29
6.S191 Introduction to Deep Learning
Why generative models? Debiasing
vs
Capable of uncovering underlying latent variables in a dataset
Homogeneous skin color, pose Diverse skin color, pose, illumination
How can we use latent distributions to create fair and representative datasets?
30
6.S191 Introduction to Deep Learning
Why generative models? Outlier detection
95% of Driving Data:
(1) sunny, (2) highway, (3) straight road
Detect outliers to avoid unpredictable behavior when training
Edge Cases Harsh Weather Pedestrians
• Problem: How can we detect when
we encounter something new or rare?
• Strategy: Leverage generative
models, detect outliers in the
distribution
• Use outliers during training to
improve even more!
31
Latent variable models
Autoencoders andVariational
Autoencoders (VAEs)
Generative Adversarial
Networks (GANs)
32
6.S191 Introduction to Deep Learning
What is a latent variable?
Myth of the Cave
515c~d
33
Matrix (1999)
34
6.S191 Introduction to Deep Learning
What is a latent variable?
Can we learn the true explanatory factors, e.g. latent variables, from only observed data?
35
Autoencoders
36
6.S191 Introduction to Deep Learning
Autoencoders: background
Unsupervised approach for learning a lower-dimensional feature
representation from unlabeled training data
! "
“Encoder” learns mapping from the data, !, to a low-dimensional latent space, "
Why do we care about a
low-dimensional "?
37
6.S191 Introduction to Deep Learning
Autoencoders: background
How can we learn this latent space?
Train the model to use these features to reconstruct the original data
! "
“Decoder” learns mapping back from latent, ", to a reconstructed observation, #!
#!
38
6.S191 Introduction to Deep Learning
Autoencoders: background
How can we learn this latent space?
Train the model to use these features to reconstruct the original data
! " #!
ℒ !, #! = ! − #! ( Loss function doesn’t
use any labels!!
39
6.S191 Introduction to Deep Learning
Autoencoders: background
How can we learn this latent space?
Train the model to use these features to reconstruct the original data
! " #!
ℒ !, #! = ! − #! ( Loss function doesn’t
use any labels!!
40
6.S191 Introduction to Deep Learning
Dimensionality of latent space à
reconstruction quality
2D latent space 5D latent space GroundTruth
Autoencoding is a form of compression!
Smaller latent space will force a larger training bottleneck
41
6.S191 Introduction to Deep Learning
Autoencoders for representation learning
Bottleneck hidden layer forces network to learn a compressed
latent representation
Reconstruction loss forces the latent representation to capture
(or encode) as much “information” about the data as possible
Autoencoding = Automatically encoding data
42
Variational Autoencoders (VAEs)
43
2019 ModuLabs
Taxonomy of
Generative Models
Figure credit: Ian Goodfellow, NIPS 2016 Tutorial: Generative Adversarial Networks
44
6.S191 Introduction to Deep Learning
VAEs: key difference with traditional autoencoder
! " #!
45
6.S191 Introduction to Deep Learning
VAEs: key difference with traditional autoencoder
! " #!
$
%
46
6.S191 Introduction to Deep Learning
VAEs: key difference with traditional autoencoder
! " #!
$
%
mean
vector
standard deviation
vector
Variational autoencoders are a probabilistic twist on autoencoders!
Sample from the mean and standard dev. to compute latent sample
47
6.S191 Introduction to Deep Learning
VAE optimization
! " #!
$
%
Encoder computes: &'(z|!) Decoder computes: ,-(x|")
48
6.S191 Introduction to Deep Learning
VAE optimization
! " #!
$
%
Encoder computes: &'(z|!) Decoder computes:,-(x|")
ℒ ϕ, 2 = (reconstruction loss) + (regularization term)
49
6.S191 Introduction to Deep Learning
VAE optimization
! " #!
$
%
Encoder computes: &'(z|!) Decoder computes:,-(x|")
ℒ ϕ, 2, ! = (reconstruction loss) + (regularization term)
50
6.S191 Introduction to Deep Learning
VAE optimization
! " #!
$
%
Encoder computes: &'(z|!) Decoder computes:,-(x|")
ℒ ϕ, 2, ! = (reconstruction loss) + (regularization term)
e.g. ! − #! 5
51
6.S191 Introduction to Deep Learning
VAE optimization
! " #!
$
%
Encoder computes: &'(z|!) Decoder computes:,-(x|")
ℒ ϕ, 2, ! = (reconstruction loss) + (regularization term)
4 &' z ! ∥ & "
Inferred latent
distribution
Fixed prior on
latent distribution
52
6.S191 Introduction to Deep Learning
Priors on the latent distribution
! "# z % ∥ " '
Inferred latent
distribution
Fixed prior on
latent distribution
Common choice of prior:
" ' = ) * = 0, -. = 1
• Encourages encodings to distribute encodings evenly around
the center of the latent space
• Penalize the network when it tries to “cheat” by clustering
points in specific regions (ie. memorizing the data)
53
6.S191 Introduction to Deep Learning
Priors on the latent distribution
! "# z % ∥ " '
Common choice of prior:
" ' = ) * = 0, -. = 1
• Encourages encodings to distribute encodings evenly around
the center of the latent space
• Penalize the network when it tries to “cheat” by clustering
points in specific regions (ie. memorizing the data)
= −
1
2
2
345
678
-3 + *3
.
− 1 − log -3
KL-divergence between
the two distributions
54
6.S191 Introduction to Deep Learning
VAEs computation graph
! " #!
$
%
Encoder computes: &'(z|!) Decoder computes:,-(x|")
ℒ ϕ, 2, ! = (reconstruction loss) + (regularization term)
55
6.S191 Introduction to Deep Learning
VAEs computation graph
! " #!
$
%
Encoder computes: &'(z|!) Decoder computes:,-(x|")
ℒ ϕ, 2, ! = (reconstruction loss) + (regularization term)
Problem: We cannot backpropagate gradients through sampling layers!
56
6.S191 Introduction to Deep Learning
Reparametrizing the sampling layer
!
"
#
Key Idea:
! ~%(", #()
Consider the sampled latent
vector as a sum of
• a fixed " vector,
• and fixed # vector, scaled by
random constants drawn from
the prior distribution
⇒ ! = " + #⨀.
where .~%(0,1)
57
6.S191 Introduction to Deep Learning
Reparametrizing the sampling layer
!
"" ∼ $%(z|))
+ )
Deterministic node
Stochastic node
Original form
Backprop
58
6.S191 Introduction to Deep Learning
Reparametrizing the sampling layer
!
"" ∼ $%(z|))
!
" " = ,(-, ), /)
- ) /- )
Deterministic node
Stochastic node
Original form Reparametrized form
0!
0"
0!
0-
Backprop
~2(0,1)
59
6.S191 Introduction to Deep Learning
VAEs: Latent perturbation
Slowly increase or decrease a single latent variable
Keep all other variables fixed
Head pose
Different dimensions of ! encodes different interpretable latent features
60
6.S191 Introduction to Deep Learning
VAEs: Latent perturbation
Head pose
Smile
Ideally, we want latent variables that
are uncorrelated with each other
Enforce diagonal prior on the latent
variables to encourage
independence
Disentanglement
61
6.S191 Introduction to Deep Learning
VAEs: Latent perturbation
Google BeatBlender
GoogleBeatBlender
62
GoogleBeatBlender
63
6.S191 Introduction to Deep Learning
VAE summary
1. Compress representation of world to something we can use to learn
2. Reconstruction allows for unsupervised learning (no labels!)
3. Reparameterization trick to train end-to-end
4. Interpret hidden latent variables using perturbation
5. Generating new examples
! " #!
64
Generative Adversarial Networks (GANs)
65
2019 ModuLabs
“The most important idea in Machine Learning in
the last 20 years”
66
2019 ModuLabs
Taxonomy of
Generative Models
Figure credit: Ian Goodfellow, NIPS 2016 Tutorial: Generative Adversarial Networks
67
6.S191 Introduction to Deep Learning
What if we just want to sample?
Idea: don’t explicitly model density, and instead just sample to generate new instances.
Problem: want to sample from complex distribution – can’t do this directly!
Solution: sample from something simple (noise), learn a
transformation to the training distribution.
!noise "
#$%&'
“fake” sample from the
training distribution
Generator Network "
68
6.S191 Introduction to Deep Learning
Generative Adversarial Networks (GANs)
Generative Adversarial Networks (GANs) are a way to make a generative
model by having two neural networks compete with each other.
The discriminator tries to identify real
data from fakes created by the generator.
The generator turns noise into an imitation
of the data to try to trick the discriminator.
!noise "
#
$%&'($)'*&
+
69
Intuition
70
GameTheory and GANs
71
6.S191 Introduction to Deep Learning
Intuition behind GANs
Generator
Generator starts from noise to try to create an imitation of the data.
Fake data
OneMoreTime!
72
6.S191 Introduction to Deep Learning
Intuition behind GANs
Discriminator Generator
Discriminator looks at both real data and fake data created by the generator.
Fake data
73
6.S191 Introduction to Deep Learning
Intuition behind GANs
Discriminator Generator
Discriminator looks at both real data and fake data created by the generator.
Real data Fake data
74
6.S191 Introduction to Deep Learning
Intuition behind GANs
Discriminator Generator
! "#$% = 1
Discriminator tries to predict what’s real and what’s fake.
Real data Fake data
75
6.S191 Introduction to Deep Learning
Intuition behind GANs
Discriminator Generator
! "#$% = 1
Discriminator tries to predict what’s real and what’s fake.
Real data Fake data
76
6.S191 Introduction to Deep Learning
Intuition behind GANs
Discriminator Generator
! "#$% = 1
Discriminator tries to predict what’s real and what’s fake.
Real data Fake data
77
6.S191 Introduction to Deep Learning
Intuition behind GANs
Discriminator Generator
! "#$% = 1
Discriminator tries to predict what’s real and what’s fake.
Real data Fake data
78
6.S191 Introduction to Deep Learning
Intuition behind GANs
Discriminator Generator
! "#$% = 1
Generator tries to improve its imitation of the data.
Real data Fake data
79
6.S191 Introduction to Deep Learning
Intuition behind GANs
Discriminator Generator
! "#$% = 1
Generator tries to improve its imitation of the data.
Real data Fake data
80
6.S191 Introduction to Deep Learning
Intuition behind GANs
Discriminator Generator
! "#$% = 1
Generator tries to improve its imitation of the data.
Real data Fake data
81
6.S191 Introduction to Deep Learning
Intuition behind GANs
Discriminator Generator
! "#$% = 1
Discriminator tries to predict what’s real and what’s fake.
Real data Fake data
82
6.S191 Introduction to Deep Learning
Intuition behind GANs
Discriminator Generator
! "#$% = 1
Discriminator tries to predict what’s real and what’s fake.
Real data Fake data
83
6.S191 Introduction to Deep Learning
Intuition behind GANs
Discriminator Generator
! "#$% = 1
Discriminator tries to predict what’s real and what’s fake.
Real data Fake data
84
6.S191 Introduction to Deep Learning
Intuition behind GANs
GeneratorDiscriminator
! "#$% = 1
Discriminator tries to predict what’s real and what’s fake.
Real data Fake data
85
6.S191 Introduction to Deep Learning
Intuition behind GANs
Discriminator Generator
! "#$% = 1
Generator tries to improve its imitation of the data.
Real data Fake data
86
6.S191 Introduction to Deep Learning
Intuition behind GANs
Discriminator
! "#$% = 1
Generator
Generator tries to improve its imitation of the data.
Real data Fake data
87
6.S191 Introduction to Deep Learning
Intuition behind GANs
Discriminator
! "#$% = 1
Generator
Generator tries to improve its imitation of the data.
Real data Fake data
88
6.S191 Introduction to Deep Learning
Intuition behind GANs
Discriminator
! "#$% = 1
Real data Fake data
Generator
Discriminator tries to identify real data from fakes created by the generator.
Generator tries to create imitations of data to trick the discriminator.
89
6.S191 Introduction to Deep Learning
Training GANs
Discriminator tries to identify real data from fakes created by the generator.
Generator tries to create imitations of data to trick the discriminator.
min
$%
max
$(
)*~,(-.-
log 2$(
3 + )5~,(5) log 1 − 2$(
:$%
(;)
Train GAN jointly via minimax game:
Discriminator wants to maximize objective s.t. 2 3 close to 1, 2 :(; ) close to 0.
Generator wants to minimize objective s.t. 2 :(; ) close to 1.
90
6.S191 Introduction to Deep Learning
Why GANs?
A. Courville, 6S191 2018.
91
6.S191 Introduction to Deep Learning
Why GANs?
A. Courville, 6S191 2018.
92
6.S191 Introduction to Deep Learning
Generating new data with GANs
After training, use generator network to create new data that’s never been seen before.
!noise "
#
$%&'($)'*&
+
93
6.S191 Introduction to Deep Learning
Deep Generative Modeling: Summary
Autoencoders and Variational
Autoencoders (VAEs)
Generative Adversarial
Networks (GANs)
Competing generator and
discriminator networks
Learn lower-dimensional latent
space and sample to generate
input reconstructions
95
Cool stuffs to do with GANs
CycleGAN Failure Case
97
GANs: Recent Advances
98
6.S191 Introduction to Deep Learning
Progressive growing of GANs (NVIDIA)
Karras et al., ICLR 2018.
99
6.S191 Introduction to Deep Learning
Style-based generator: results
Karras et al.,Arxiv 2018.
100
6.S191 Introduction to Deep Learning
Style-based transfer: results
Karras et al.,Arxiv 2018.
101
102

AI 로봇 아티스트의 비밀(창원대학교 정보통신공학과 특강)

  • 1.
    AI 로봇 아티스트의비밀 Deep Generative Models 2019-05-23 Sung-Soo Kim sungsoo@etri.re.kr Smart Data Research Group 특강
  • 2.
    Outline ! Introduction – ArtificialIntelligence,MachineLearning,DeepLearning !Autoencoders ! Variational Autoencoders (VAEs) ! Generative Adversarial Networks (GANs) ! Summary
  • 3.
  • 4.
    4 6.S191 Introduction toDeep Learning Which face is fake?
  • 5.
  • 6.
  • 7.
  • 8.
  • 9.
    Dog Cat 입력이 주어지면 출력을내보낸다. 인공지능
  • 10.
    입력이 주어지면, 출력을내보낸다. 우리 이런 걸 어디서 봤죠?
  • 11.
  • 12.
    인공지능 별 거아니죠? 무서울 것 없습니다. 근데 왜 갑자기 무서워 졌을까요?
  • 13.
    모두의연구소 수학적으로 표현할 수없었던 복잡한 인간의 두뇌를 데이터를 기반으로 흉내내다.
  • 14.
  • 15.
  • 16.
    X[n] F[n] F[n-1] Y[n] n :data index Data가 늘어날수록 점점 인공지능 알고리즘이 학습(Learning)한다.
  • 17.
  • 18.
    3 X ??? 6 DogCat Supervised Learning - 정답이 주어진다. - (비교적)문제풀이가 쉽다
  • 19.
    3 X ??? ??? Unsupervised Learning 미지수 2개,방정식 1개 풀 수 있나요?
  • 20.
    Reinforcement Learning - (정답이 아닌)reward가 주어진다. Reward
  • 21.
  • 22.
  • 23.
    뉴런과 인공뉴런 x 1 x 1 b a 다른 머신러닝 기법들과의차이점 1: Nonlinear(복잡한) activation function b a
  • 24.
    다층 레이어 (Multiple Layer) 다른머신러닝 기법들과의 차이점 2 : Nonlinear function의 Nonlinear function의 Nonlinear function … 엄청 복잡한 함수 (인공지능)을 만들 수 있다. Hidden layer가 2개이상인 NN를 Deep Learning이라고 부른다.
  • 25.
  • 26.
    26 6.S191 Introduction toDeep Learning Supervised vs unsupervised learning Supervised Learning Data: (", $) " is data, $ is label Goal: Learn function to map " → $ Examples: Classification, regression, object detection, semantic segmentation, etc. Unsupervised Learning Data: " " is data, no labels! Goal: Learn some hidden or underlying structure of the data Examples: Clustering, feature or dimensionality reduction, etc.
  • 27.
    27 6.S191 Introduction toDeep Learning Supervised vs unsupervised learning Supervised Learning Data: (", $) " is data, $ is label Goal: Learn function to map " → $ Examples: Classification, regression, object detection, semantic segmentation, etc. Unsupervised Learning Data: " " is data, no labels! Goal: Learn some hidden or underlying structure of the data Examples: Clustering, feature or dimensionality reduction, etc.
  • 28.
    28 6.S191 Introduction toDeep Learning Generative modeling Goal: Take as input training samples from some distribution and learn a model that represents that distribution Density Estimation Sample Generation Input samples Generated samples Training data ~ "#$%$ & Generated ~ "'(#)* & How can we learn "'(#)* & similar to "#$%$ & ? samples KeyTakeaway#1 KeyTakeaway#2 MainTakeaways
  • 29.
    29 6.S191 Introduction toDeep Learning Why generative models? Debiasing vs Capable of uncovering underlying latent variables in a dataset Homogeneous skin color, pose Diverse skin color, pose, illumination How can we use latent distributions to create fair and representative datasets?
  • 30.
    30 6.S191 Introduction toDeep Learning Why generative models? Outlier detection 95% of Driving Data: (1) sunny, (2) highway, (3) straight road Detect outliers to avoid unpredictable behavior when training Edge Cases Harsh Weather Pedestrians • Problem: How can we detect when we encounter something new or rare? • Strategy: Leverage generative models, detect outliers in the distribution • Use outliers during training to improve even more!
  • 31.
    31 Latent variable models AutoencodersandVariational Autoencoders (VAEs) Generative Adversarial Networks (GANs)
  • 32.
    32 6.S191 Introduction toDeep Learning What is a latent variable? Myth of the Cave 515c~d
  • 33.
  • 34.
    34 6.S191 Introduction toDeep Learning What is a latent variable? Can we learn the true explanatory factors, e.g. latent variables, from only observed data?
  • 35.
  • 36.
    36 6.S191 Introduction toDeep Learning Autoencoders: background Unsupervised approach for learning a lower-dimensional feature representation from unlabeled training data ! " “Encoder” learns mapping from the data, !, to a low-dimensional latent space, " Why do we care about a low-dimensional "?
  • 37.
    37 6.S191 Introduction toDeep Learning Autoencoders: background How can we learn this latent space? Train the model to use these features to reconstruct the original data ! " “Decoder” learns mapping back from latent, ", to a reconstructed observation, #! #!
  • 38.
    38 6.S191 Introduction toDeep Learning Autoencoders: background How can we learn this latent space? Train the model to use these features to reconstruct the original data ! " #! ℒ !, #! = ! − #! ( Loss function doesn’t use any labels!!
  • 39.
    39 6.S191 Introduction toDeep Learning Autoencoders: background How can we learn this latent space? Train the model to use these features to reconstruct the original data ! " #! ℒ !, #! = ! − #! ( Loss function doesn’t use any labels!!
  • 40.
    40 6.S191 Introduction toDeep Learning Dimensionality of latent space à reconstruction quality 2D latent space 5D latent space GroundTruth Autoencoding is a form of compression! Smaller latent space will force a larger training bottleneck
  • 41.
    41 6.S191 Introduction toDeep Learning Autoencoders for representation learning Bottleneck hidden layer forces network to learn a compressed latent representation Reconstruction loss forces the latent representation to capture (or encode) as much “information” about the data as possible Autoencoding = Automatically encoding data
  • 42.
  • 43.
    43 2019 ModuLabs Taxonomy of GenerativeModels Figure credit: Ian Goodfellow, NIPS 2016 Tutorial: Generative Adversarial Networks
  • 44.
    44 6.S191 Introduction toDeep Learning VAEs: key difference with traditional autoencoder ! " #!
  • 45.
    45 6.S191 Introduction toDeep Learning VAEs: key difference with traditional autoencoder ! " #! $ %
  • 46.
    46 6.S191 Introduction toDeep Learning VAEs: key difference with traditional autoencoder ! " #! $ % mean vector standard deviation vector Variational autoencoders are a probabilistic twist on autoencoders! Sample from the mean and standard dev. to compute latent sample
  • 47.
    47 6.S191 Introduction toDeep Learning VAE optimization ! " #! $ % Encoder computes: &'(z|!) Decoder computes: ,-(x|")
  • 48.
    48 6.S191 Introduction toDeep Learning VAE optimization ! " #! $ % Encoder computes: &'(z|!) Decoder computes:,-(x|") ℒ ϕ, 2 = (reconstruction loss) + (regularization term)
  • 49.
    49 6.S191 Introduction toDeep Learning VAE optimization ! " #! $ % Encoder computes: &'(z|!) Decoder computes:,-(x|") ℒ ϕ, 2, ! = (reconstruction loss) + (regularization term)
  • 50.
    50 6.S191 Introduction toDeep Learning VAE optimization ! " #! $ % Encoder computes: &'(z|!) Decoder computes:,-(x|") ℒ ϕ, 2, ! = (reconstruction loss) + (regularization term) e.g. ! − #! 5
  • 51.
    51 6.S191 Introduction toDeep Learning VAE optimization ! " #! $ % Encoder computes: &'(z|!) Decoder computes:,-(x|") ℒ ϕ, 2, ! = (reconstruction loss) + (regularization term) 4 &' z ! ∥ & " Inferred latent distribution Fixed prior on latent distribution
  • 52.
    52 6.S191 Introduction toDeep Learning Priors on the latent distribution ! "# z % ∥ " ' Inferred latent distribution Fixed prior on latent distribution Common choice of prior: " ' = ) * = 0, -. = 1 • Encourages encodings to distribute encodings evenly around the center of the latent space • Penalize the network when it tries to “cheat” by clustering points in specific regions (ie. memorizing the data)
  • 53.
    53 6.S191 Introduction toDeep Learning Priors on the latent distribution ! "# z % ∥ " ' Common choice of prior: " ' = ) * = 0, -. = 1 • Encourages encodings to distribute encodings evenly around the center of the latent space • Penalize the network when it tries to “cheat” by clustering points in specific regions (ie. memorizing the data) = − 1 2 2 345 678 -3 + *3 . − 1 − log -3 KL-divergence between the two distributions
  • 54.
    54 6.S191 Introduction toDeep Learning VAEs computation graph ! " #! $ % Encoder computes: &'(z|!) Decoder computes:,-(x|") ℒ ϕ, 2, ! = (reconstruction loss) + (regularization term)
  • 55.
    55 6.S191 Introduction toDeep Learning VAEs computation graph ! " #! $ % Encoder computes: &'(z|!) Decoder computes:,-(x|") ℒ ϕ, 2, ! = (reconstruction loss) + (regularization term) Problem: We cannot backpropagate gradients through sampling layers!
  • 56.
    56 6.S191 Introduction toDeep Learning Reparametrizing the sampling layer ! " # Key Idea: ! ~%(", #() Consider the sampled latent vector as a sum of • a fixed " vector, • and fixed # vector, scaled by random constants drawn from the prior distribution ⇒ ! = " + #⨀. where .~%(0,1)
  • 57.
    57 6.S191 Introduction toDeep Learning Reparametrizing the sampling layer ! "" ∼ $%(z|)) + ) Deterministic node Stochastic node Original form Backprop
  • 58.
    58 6.S191 Introduction toDeep Learning Reparametrizing the sampling layer ! "" ∼ $%(z|)) ! " " = ,(-, ), /) - ) /- ) Deterministic node Stochastic node Original form Reparametrized form 0! 0" 0! 0- Backprop ~2(0,1)
  • 59.
    59 6.S191 Introduction toDeep Learning VAEs: Latent perturbation Slowly increase or decrease a single latent variable Keep all other variables fixed Head pose Different dimensions of ! encodes different interpretable latent features
  • 60.
    60 6.S191 Introduction toDeep Learning VAEs: Latent perturbation Head pose Smile Ideally, we want latent variables that are uncorrelated with each other Enforce diagonal prior on the latent variables to encourage independence Disentanglement
  • 61.
    61 6.S191 Introduction toDeep Learning VAEs: Latent perturbation Google BeatBlender GoogleBeatBlender
  • 62.
  • 63.
    63 6.S191 Introduction toDeep Learning VAE summary 1. Compress representation of world to something we can use to learn 2. Reconstruction allows for unsupervised learning (no labels!) 3. Reparameterization trick to train end-to-end 4. Interpret hidden latent variables using perturbation 5. Generating new examples ! " #!
  • 64.
  • 65.
    65 2019 ModuLabs “The mostimportant idea in Machine Learning in the last 20 years”
  • 66.
    66 2019 ModuLabs Taxonomy of GenerativeModels Figure credit: Ian Goodfellow, NIPS 2016 Tutorial: Generative Adversarial Networks
  • 67.
    67 6.S191 Introduction toDeep Learning What if we just want to sample? Idea: don’t explicitly model density, and instead just sample to generate new instances. Problem: want to sample from complex distribution – can’t do this directly! Solution: sample from something simple (noise), learn a transformation to the training distribution. !noise " #$%&' “fake” sample from the training distribution Generator Network "
  • 68.
    68 6.S191 Introduction toDeep Learning Generative Adversarial Networks (GANs) Generative Adversarial Networks (GANs) are a way to make a generative model by having two neural networks compete with each other. The discriminator tries to identify real data from fakes created by the generator. The generator turns noise into an imitation of the data to try to trick the discriminator. !noise " # $%&'($)'*& +
  • 69.
  • 70.
  • 71.
    71 6.S191 Introduction toDeep Learning Intuition behind GANs Generator Generator starts from noise to try to create an imitation of the data. Fake data OneMoreTime!
  • 72.
    72 6.S191 Introduction toDeep Learning Intuition behind GANs Discriminator Generator Discriminator looks at both real data and fake data created by the generator. Fake data
  • 73.
    73 6.S191 Introduction toDeep Learning Intuition behind GANs Discriminator Generator Discriminator looks at both real data and fake data created by the generator. Real data Fake data
  • 74.
    74 6.S191 Introduction toDeep Learning Intuition behind GANs Discriminator Generator ! "#$% = 1 Discriminator tries to predict what’s real and what’s fake. Real data Fake data
  • 75.
    75 6.S191 Introduction toDeep Learning Intuition behind GANs Discriminator Generator ! "#$% = 1 Discriminator tries to predict what’s real and what’s fake. Real data Fake data
  • 76.
    76 6.S191 Introduction toDeep Learning Intuition behind GANs Discriminator Generator ! "#$% = 1 Discriminator tries to predict what’s real and what’s fake. Real data Fake data
  • 77.
    77 6.S191 Introduction toDeep Learning Intuition behind GANs Discriminator Generator ! "#$% = 1 Discriminator tries to predict what’s real and what’s fake. Real data Fake data
  • 78.
    78 6.S191 Introduction toDeep Learning Intuition behind GANs Discriminator Generator ! "#$% = 1 Generator tries to improve its imitation of the data. Real data Fake data
  • 79.
    79 6.S191 Introduction toDeep Learning Intuition behind GANs Discriminator Generator ! "#$% = 1 Generator tries to improve its imitation of the data. Real data Fake data
  • 80.
    80 6.S191 Introduction toDeep Learning Intuition behind GANs Discriminator Generator ! "#$% = 1 Generator tries to improve its imitation of the data. Real data Fake data
  • 81.
    81 6.S191 Introduction toDeep Learning Intuition behind GANs Discriminator Generator ! "#$% = 1 Discriminator tries to predict what’s real and what’s fake. Real data Fake data
  • 82.
    82 6.S191 Introduction toDeep Learning Intuition behind GANs Discriminator Generator ! "#$% = 1 Discriminator tries to predict what’s real and what’s fake. Real data Fake data
  • 83.
    83 6.S191 Introduction toDeep Learning Intuition behind GANs Discriminator Generator ! "#$% = 1 Discriminator tries to predict what’s real and what’s fake. Real data Fake data
  • 84.
    84 6.S191 Introduction toDeep Learning Intuition behind GANs GeneratorDiscriminator ! "#$% = 1 Discriminator tries to predict what’s real and what’s fake. Real data Fake data
  • 85.
    85 6.S191 Introduction toDeep Learning Intuition behind GANs Discriminator Generator ! "#$% = 1 Generator tries to improve its imitation of the data. Real data Fake data
  • 86.
    86 6.S191 Introduction toDeep Learning Intuition behind GANs Discriminator ! "#$% = 1 Generator Generator tries to improve its imitation of the data. Real data Fake data
  • 87.
    87 6.S191 Introduction toDeep Learning Intuition behind GANs Discriminator ! "#$% = 1 Generator Generator tries to improve its imitation of the data. Real data Fake data
  • 88.
    88 6.S191 Introduction toDeep Learning Intuition behind GANs Discriminator ! "#$% = 1 Real data Fake data Generator Discriminator tries to identify real data from fakes created by the generator. Generator tries to create imitations of data to trick the discriminator.
  • 89.
    89 6.S191 Introduction toDeep Learning Training GANs Discriminator tries to identify real data from fakes created by the generator. Generator tries to create imitations of data to trick the discriminator. min $% max $( )*~,(-.- log 2$( 3 + )5~,(5) log 1 − 2$( :$% (;) Train GAN jointly via minimax game: Discriminator wants to maximize objective s.t. 2 3 close to 1, 2 :(; ) close to 0. Generator wants to minimize objective s.t. 2 :(; ) close to 1.
  • 90.
    90 6.S191 Introduction toDeep Learning Why GANs? A. Courville, 6S191 2018.
  • 91.
    91 6.S191 Introduction toDeep Learning Why GANs? A. Courville, 6S191 2018.
  • 92.
    92 6.S191 Introduction toDeep Learning Generating new data with GANs After training, use generator network to create new data that’s never been seen before. !noise " # $%&'($)'*& +
  • 93.
    93 6.S191 Introduction toDeep Learning Deep Generative Modeling: Summary Autoencoders and Variational Autoencoders (VAEs) Generative Adversarial Networks (GANs) Competing generator and discriminator networks Learn lower-dimensional latent space and sample to generate input reconstructions
  • 95.
    95 Cool stuffs todo with GANs
  • 96.
  • 97.
  • 98.
    98 6.S191 Introduction toDeep Learning Progressive growing of GANs (NVIDIA) Karras et al., ICLR 2018.
  • 99.
    99 6.S191 Introduction toDeep Learning Style-based generator: results Karras et al.,Arxiv 2018.
  • 100.
    100 6.S191 Introduction toDeep Learning Style-based transfer: results Karras et al.,Arxiv 2018.
  • 101.
  • 102.