CS3750: ADVANCED MACHINE LEARNING GENERATIVE ADVERSARIAL NETWORKS - - PDF document

β–Ά
cs3750 advanced machine learning generative adversarial
SMART_READER_LITE
LIVE PREVIEW

CS3750: ADVANCED MACHINE LEARNING GENERATIVE ADVERSARIAL NETWORKS - - PDF document

2/11/2020 CS3750: ADVANCED MACHINE LEARNING GENERATIVE ADVERSARIAL NETWORKS Adapted from Slides made by Khushboo Thaker Presented by Tristan Maidment GROWTH (AND DECLINE) IN GAN PAPERS 1 2/11/2020 Overview Why Existing MiniMax


slide-1
SLIDE 1

2/11/2020 1

CS3750: ADVANCED MACHINE LEARNING GENERATIVE ADVERSARIAL NETWORKS

Adapted from Slides made by Khushboo Thaker Presented by Tristan Maidment

GROWTH (AND DECLINE) IN GAN PAPERS

slide-2
SLIDE 2

2/11/2020 2

Overview

Why Generative Modelling? Existing Generative Models Properties of GANs GAN Framework MiniMax game theory for GANs Why GAN training is HARD Tricks for GAN training Common extensions to GANS Conclusion

Generative Modelling

Inpu nput

Training Examples

Outp tput ut

Some representation of a probability distribution, which defines this example space.

Unsu super pervise ised

Data: X Goal: Learn hidden underlying structure of data

Super pervised ised

Data: X, y Goal: Learn hidden mapping from X -> y

slide-3
SLIDE 3

2/11/2020 3

Why Generative Modelling?

Noisy Input Simulated Data Features Representative of Data Prediction of Future State Missing Data Semi-supervised Learning

MAXIMUM LIKELIHOOD BASED MODELS π‘ž 𝑦 | πœ„βˆ— = ARGMAX πœ„ | 𝐹𝑦~π‘„π‘’π‘π‘’π‘π‘šπ‘π‘•π‘„(𝑦 πœ„)

slide-4
SLIDE 4

2/11/2020 4

PixelRNN PixelCNN WaveNet

  • Generate image pixels from the corner
  • Stable and Fast training
  • Slow generation (sequential)
  • Cannot generate samples based on latent code
  • Tractable
  • π‘ž 𝑦 = ς𝑗=1

π‘œ

π‘ž(𝑦𝑗|𝑦1,𝑦2,… , π‘¦π‘—βˆ’1 )

  • Maximum Likelihood based Training
  • Chain Rule
slide-5
SLIDE 5

2/11/2020 5

Variational Auto Encoder

  • Able to achieve high likelihood
  • Not asymptotically consistent unless q is perfect
  • Lower Quality (blurry) samples
  • Non tractable
  • log π‘ž 𝑦 β‰₯ log π‘ž 𝑦 βˆ’ 𝐸𝐿𝑀(π‘Ÿ 𝑨 || π‘ž(𝑨|𝑦))

= 𝐹𝑨~π‘Ÿ log π‘ž(𝑦, 𝑨) + 𝐼(π‘Ÿ)

Boltzmann Machine

  • Energy Function Based Model
  • Markov Chains don’t work for long sequences
  • Hard to scale on large dataset
  • π‘ž 𝑦, β„Ž = exp βˆ’πΉ 𝑦, β„Ž

| π‘Ž

  • π‘Ž = σ𝑦,β„Ž exp(βˆ’πΉ 𝑦, β„Ž )
slide-6
SLIDE 6

2/11/2020 6

Where are some properties of GANs?

Can use latent information Asymptotically consistent No Markov Chain assumption Samples produced are high quality

slide-7
SLIDE 7

2/11/2020 7

NEXT FRAME VIDEO GENERATION

slide-8
SLIDE 8

2/11/2020 8

Generative Adversarial Networks

https://www.slideshare.net/xavigiro/deep-learning-for-computer-vision-generative-models-and-adversarial-training-upc-2016

z G G(z) x D D(x) D(G(z))

slide-9
SLIDE 9

2/11/2020 9

slide-10
SLIDE 10

2/11/2020 10

Generative Adversarial Networks

β€œThe generative model can be thought of as analogous to a team

  • f counterfeiters, trying to produce fake currency and use it

without detection, while the discriminative model is analogous to the police, trying to detect the counterfeit currency. Competition in this game drives both teams to improve their methods until the counterfeits are indistinguishable from the genuine articles.” – Goodfellow, et. Al. β€œGenerative Adversarial Nets” (2014)

Minimax Game Approach

  • Generator minimizes the log-probability of the

discriminator being correct

  • Resembles Jensen-Shannon divergence
  • Saddle point of Discriminator’s loss
slide-11
SLIDE 11

2/11/2020 11

Minimax Game Approach

  • Generator minimizes the log-probability of the

discriminator being correct

  • Resembles Jensen-Shannon divergence
  • Saddle point of Discriminator’s loss

Vanishing Gradient Problem

  • Gradient disappears if D is confident, i.e. D(G(z)) β†’ 0
  • As can be seen that whenever the discriminator becomes

very confident the loss value will be zero

  • Nothing to improve for Generator
slide-12
SLIDE 12

2/11/2020 12

Heuristic Non- Saturating Games

  • Generator maximizes the log probability of the

discriminator’s mistake

  • Does not change when discriminator is successful

COMPARISON OF GENERATOR LOSSES

slide-13
SLIDE 13

2/11/2020 13

MODE COLLAPSE π‘›π‘—π‘œπ»π‘›π‘π‘¦πΈπ‘Š 𝐻,𝐸 β‰  π‘›π‘π‘¦πΈπ‘›π‘—π‘œπ»π‘Š 𝐻,𝐸

slide-14
SLIDE 14

2/11/2020 14

Why are GANs hard to train?

GENERATOR KEEPS GENERATING SIMILAR IMAGES – SO NOTHING TO LEARN MAINTAIN TRADE-OFF OF GENERATING MORE ACCURATE VS HIGH COVERAGE SAMPLES THE TWO LEARNING TASKS NEED TO HAVE BALANCE TO ACHIEVE STABILITY IF DISCRIMINATOR IS NOT SUFFICIENTLY TRAINED – LEADS TO POOR GENERATOR PERFORMANCE IF DISCRIMINATOR IS OVER- TRAINED – VANISHING GRADIENT PROBLEM

slide-15
SLIDE 15

2/11/2020 15

Tricks to Train GANs

One-Sided Label Smoothing Historically generated batches Feature Matching Batch Normalization Regularizing discriminator gradient in region around real data (DRAGAN)

One-Sided Label Smoothing

  • Generator is VERY sensitive to output from Discriminator
  • Regulates Discriminator gradients
  • Does-not reduce accuracy
  • Increases confidence
  • Only smooth positive samples
slide-16
SLIDE 16

2/11/2020 16

Feature Matching

  • Generated images must match statistics of real images
  • Discriminator defines the statistics
  • Generator is trained such that the expected value of statistics matches the expected value of real statistics
  • Generator tries to minimize the L2 distance in expected values in some arbitrary space
  • Discriminator defines that arbitrary space

Batch Normalization

  • Construct different mini-batches for real and fake
  • Each mini-batch needs to contain only all real

images or all generated images.

  • Makes samples with-in a batch less dependent
slide-17
SLIDE 17

2/11/2020 17

DRAGAN

  • Failed GANs typically have extreme gradients/sharp

peaks around real data

  • Regularize GANs to reduce the gradient of the

discriminator in region around real data

GAN Variations

  • Conditional GAN
  • LapGAN
  • DCGAN
  • CatGAN
  • InfoGan
  • AAE
  • DRAGAN
  • IRGAN
  • ProGAN
  • and more!
slide-18
SLIDE 18

2/11/2020 18

DCGAN

  • Multiple Convolutional

Layers

  • Batch Normalization
  • Strides with Convolution
  • Leaky ReLUs

DCGAN

  • Multiple Convolutional

Layers

  • Batch Normalization
  • Strides with Convolution
  • Leaky ReLUs
slide-19
SLIDE 19

2/11/2020 19

DCGAN

  • Multiple Convolutional

Layers

  • Batch Normalization
  • Strides with Convolution
  • Leaky ReLUs

Conditional GANs P(X|Y)

  • Generator Learns P(X|Z,Y)
  • Discriminator Learns P(L|X,Y)
slide-20
SLIDE 20

2/11/2020 20

InfoGAN

  • Rewards Disentanglement
  • (individual dimensions capturing key attributes of images)
  • Z – partitioned into two parts
  • z – capture slight variation in the images
  • y – captures the main attributes of the images
  • Mutual Information
  • maximizing mutual information Between the code and generator output
slide-21
SLIDE 21

2/11/2020 21

InfoGAN

BiGAN

  • Encoder
  • Decoder
  • Discriminator
slide-22
SLIDE 22

2/11/2020 22

LapGAN

  • Scale GANs for large

images

  • Laplacian pyramid

function is used to generate different scales

  • f image

LapGAN

  • Scale GANs for large

images

  • Laplacian pyramid

function is used to generate different scales

  • f image
slide-23
SLIDE 23

2/11/2020 23

PROGAN

ADVERSARIAL AUTOENCODER (GAN + VAE)

slide-24
SLIDE 24

2/11/2020 24

Conclusion

GAN is still an active area of research GAN framework is flexible to support variety of learning problems GAN does not guarantee to converge GAN can capture perceptual similarity and generates better images than VAE Needs a lot of work in theoretic foundation of Network Evaluation of GAN is still an open research (Theis et. al)

slide-25
SLIDE 25

2/11/2020 25

Software

  • https://github.com/eriklindernoren/Keras-GAN
  • https://github.com/eriklindernoren/PyTorch-GAN
  • https://github.com/znxlwm/tensorflow-MNIST-cGAN-cDCGAN

References

Deep Learning Book GAN paper: https://arxiv.org/abs/1701.00160 GAN slides: http://slazebni.cs.illinois.edu/spring17/lec11_gan.pd GAN Tutorial: https://www.youtube.com/watch?v=HGYYEUSm-0Q

slide-26
SLIDE 26

2/11/2020 26

THANK YOU!