Share
Embed
Transcript
79 slides
-
2012 2013 2014 2015 2016 2017 2018 generative adversarial reinforcement
Goodfellow et al., 2014 GAN becomes a very important technology Number of papers whose titles include the keyword -
All Kinds of GAN … GAN WGAN BGAN DCGAN ACGAN
fGAN LCC-GAN (ICML) CGAN …… -
GAN Zoo ACGAN BGAN CGAN DGAN EGAN fGAN GAGAN HiGAN
iGAN JointGAN LCC-GAN KGAN MGAN NetGAN OT-GAN PGAN RCGAN SEGAN ? TGAN UGAN VGAN WGAN XGAN ZipNet-GAN ? https://github.com/hindupuravinash/the-gan-zoo -
➢Generative Modeling ➢Generative Adversarial Networks (GANs) ➢Conditional GANs (CGANs) ➢Training
Procedure and Evaluation Methods ➢Common Issues and Some Tips ➢Some Applications Contents -
Generative Modeling • Have training examples ~ () • Want
a model that can draw samples: ~ () • Where () ≈ () ~ () ~ () -
Why Generative Models? • Generative models — Date generation —
Speech synthesis: — Machine translation: Chinese English • Chinese: 我喜欢深度学习。 • English: I love deep learning. • Environment simulator — Reinforcement learning — Planning • Leverage unlabeled data -
Data Generation Generator Image Generation 0.3 −0.1 ⋮ −0.7 In
a specific range -
Data Generation Generator Image Generation 0.1 −0.1 ⋮ 0.7 0.3
−0.1 ⋮ −0.7 In a specific range -
Data Generation Generator Image Generation 0.1 −0.1 ⋮ 0.7 −0.3
0.1 ⋮ 0.9 0.3 −0.1 ⋮ −0.7 In a specific range -
Data Generation Generator Image Generation Sentence Generation 0.1 −0.1 ⋮
0.7 −0.3 0.1 ⋮ 0.9 0.3 −0.1 ⋮ −0.7 In a specific range -
Data Generation Generator Image Generation Sentence Generation Generator 0.1 −0.1
⋮ 0.7 −0.3 0.1 ⋮ 0.9 How are you? 0.3 −0.1 ⋮ −0.7 0.3 −0.1 ⋮ −0.7 In a specific range -
Data Generation Generator Image Generation Sentence Generation Generator 0.1 −0.1
⋮ 0.7 −0.3 0.1 ⋮ 0.9 0.1 −0.1 ⋮ 0.2 Good morning. How are you? 0.3 −0.1 ⋮ −0.7 0.3 −0.1 ⋮ −0.7 In a specific range -
Data Generation Generator Image Generation Sentence Generation Generator 0.1 −0.1
⋮ 0.7 −0.3 0.1 ⋮ 0.9 0.1 −0.1 ⋮ 0.2 −0.3 0.1 ⋮ 0.5 Good morning. How are you? 0.3 −0.1 ⋮ −0.7 0.3 −0.1 ⋮ −0.7 Good afternoon. In a specific range -
➢Generative modeling ➢Generative adversarial networks (GANs) ➢Conditional GANs (CGANs) ➢Training
procedure and evaluation methods ➢Common issues and some tips ➢Some Applications Contents -
A Game Theory Perspective ➢Two agents: — Generative model G:
generate new samples that are as similar as data and fool the discriminator — Discriminative model D: act as a judge to distinguish the generated samples from the real one adversarial Generator Discriminator Vs -
Generator Network • G is a neural network with parameters
. • is a latent variable drawn from a prior distribution. • Trainable for any size of A generative model tries to learn the distribution of real data from the prior distribution (). -
Generator Generator It is a neural network (NN), or a
function. Generator 0.1 −3 ⋮ 2.4 0.9 image vector Generator 3 −3 ⋮ 2.4 0.9 Generator 0.1 2.1 ⋮ 5.4 0.9 Generator 0.1 −3 ⋮ 2.4 3.5 high dimensional vector Each dimension of input vector represents some characteristic. Long hair blue hair Open mouth low dimensional -
• A discriminative model learns a function that distinguish the
generated samples from the real data • (): estimate the probability that is a real data sample — = 1: regards as a real sample — = 0: regards as a fake sample Discriminative Model Binary classification -
Discriminator Probability value Image Larger value: real smaller value: fake.
Discriminator Discriminator Discriminator 1.0 1.0 0.1 Discriminator 0.1 Discriminator It is a neural network (NN), or a function. -
Discriminator of DCGAN Radford et al. 2015 Real or Fake
CONV 1 CONV 2 CONV 3 CONV 4 Image -
➢Generative modeling ➢Generative adversarial networks (GANs) ➢Conditional GANs (CGANs) ➢Training
procedure and evaluation methods ➢Common issues and some tips ➢Some Applications Contents -
Conditional GANs condition • Simple modification to the original GAN
framework that conditions the model on additional information for better multi-modal learning. • Many practical applications of GANs when we have explicit supervision available -
Conditional GANs D scalar True text-image pairs: G Gaussian distribution
x = G(c,z) c: train Image is realistic or not + c and are matched or not (train , ) (train , ) (cat , ) 1 0 0 Condition -
Conditional GANs paired data blue eyes red hair short hair
red hair, green eyes blue hair, red eyes -
➢Generative modeling ➢Generative adversarial networks (GANs) ➢Conditional GANs (CGANs) ➢Training
procedure and evaluation methods ➢Common issues and some tips ➢Some Applications Contents -
Training GANs: Two-player game Generator networks: try to fool the
discriminator by generating real-looking images Discriminator networks: try to distinguish between real and fake images -
Minimax Game • Generator minimizes the log-probability of D being
correct • Discriminator maximizes cross-entropy of real and generated data • Equilibrium is a saddle point of the discriminator loss Cross-entropy Loss -
Minimax Game • Discriminator aims to maximize objective such that
D(x) is close to 1 (real) and D(G(z)) is close to 0 (fake) • Generator aims to minimize objective such that D(G(z)) is close to 1 (discriminator is fooled into thinking generated G(z) is real) -
Training Procedure • Use SGD algorithm on two mini-batches simultaneously:
• A mini-batch of training samples • A mini-batch of generated samples • Optional: Run steps of one player for every step of the other player - example: WGAN updates Discriminator for 5 steps and Generator for 1 step. -
sample generated samples G D Update vector vector vector vector
0 0 0 0 1 1 1 1 randomly sampled Database Step 1: Fix generator G, and update discriminator D Fix Training Algorithm: Discriminator Objective of the discriminator: -
Step 2: Fix discriminator D, and update generator G Discriminator
Generator vector 0.13 hidden layer update fix large network Generator learns to “fool” the discriminator Training Algorithm: Generator Objective of the discriminator: -
• Sample m examples 1, 2, … , from database
• Sample m noise samples 1, 2, … , from a distribution • Obtaining generated data 1, 2, … , , = • Update discriminator parameters to maximize • ෨ = 1 σ =1 + 1 σ =1 1 − • ← + ෨ • Sample m noise samples 1, 2, … , from a distribution • Update generator parameters to minimize • ෨ = 1 σ =1 1 − • ← − ෨ Learning D Learning G Training Algorithm of GANs Repeat k times -
Training: An Intuitive Explanation Discriminative distribution Data distribution Generative distribution
After updating D Poorly fit model -
Training: An Intuitive Explanation Discriminative distribution Data distribution Generative distribution
Poorly fit model After updating D After updating G -
Training: An Intuitive Explanation Discriminative distribution Data distribution Generative distribution
After updating D Poorly fit model After updating G Mixed strategy equilibrium -
Evaluation: Inception Score = | | −
Negative entropy of P(y|x) Entropy of P(y) Inception Score = 1 | | class 1 class 2 class 3 Formally: Peculiarity Diversity -
❖ Multi-scale structural similarity (MS-SSIM): evaluate the diversity of the
generated samples ❖ Fré chet Inception Distance (FID) a new metric to evaluate the performance of GANs Other Evaluation Metrics -
➢Generative modeling ➢Generative adversarial networks (GANs) ➢Conditional GANs (CGANs) ➢Training
procedure and evaluation methods ➢Common issues and some tips ➢Some Applications Contents -
Common Issues in GANs • Non-convergence: although GAN training is
theoretically guaranteed to converge, the model often break down during the training • Oscillation: GAN can be trained for a very long time without clearly generating better samples • Training imbalance: discriminator becomes too strong too quickly and the generator ends up not learning anything • Mode collapse: almost all the samples look the same (very low diversity) • Visual problems: counting, perspective, global structure, etc. -
Mode Collapse Reed et al. 2016 Reed et al. submitted
to ICLR 2017 -
Cross-entropy (CE) loss: • Default discriminator cost: • One-sided label
smoothed cost (Salimans et al. 2016) : label : probability Benefits • Prevents discriminator from giving very large gradient signal to generator • Stabilize the training and prevents extrapolating to encourage extreme samples One-Sided Label Smoothing: Some Solutions -
• A modified loss function • DCGAN model design •
Track failures early (D loss goes to 0: failure mode) • If you have labels, use them • Add noise to inputs, decay over time Tricks for GANs . . . . . . -
➢Generative modeling ➢Generative adversarial networks (GANs) ➢Conditional GANs (CGANs) ➢Training
procedure and evaluation methods ➢Common issues and some tips ➢Some Applications Contents -
Latent Space Interpolation Donahue et al. 2015 https://chrisdonahue.github.io/sdgan/ z1 z2
z0.5 G(z0.5 ) G(z1 ) G(z2 ) -
Conclusions • GANs are generative models that are implemented using
two stochastic neural network modules: Generator and Discriminator. • Generator tries to generate samples from random noise as input. • Discriminator tries to distinguish the samples from Generator and samples from the real data distribution. • Both players are trained adversarially to fool each other, and they become better at their respective tasks.