Author(s): Jason Brownlee
Series: Machine Learning Mastery
Edition: v1.5
Year: 2020
Language: English
Pages: 654
Copyright
Contents
Preface
Introductions
Welcome
I Foundations
What are Generative Adversarial Networks
Overview
What Are Generative Models?
What Are Generative Adversarial Networks?
Why Generative Adversarial Networks?
Further Reading
Summary
How to Develop Deep Learning Models With Keras
Tutorial Overview
Keras Model Life-Cycle
Keras Functional Models
Standard Network Models
Further Reading
Summary
How to Upsample with Convolutional Neural Networks
Tutorial Overview
Need for Upsampling in GANs
How to Use the Upsampling Layer
How to Use the Transpose Convolutional Layer
Further Reading
Summary
How to Implement the GAN Training Algorithm
Tutorial Overview
How to Implement the GAN Training Algorithm
Understanding the GAN Loss Function
How to Train GAN Models in Practice
Further Reading
Summary
How to Implement GAN Hacks to Train Stable Models
Tutorial Overview
Challenge of Training GANs
Heuristics for Training Stable GANs
Deep Convolutional GANs (DCGANs)
Soumith Chintala's GAN Hacks
Further Reading
Summary
II GAN Basics
How to Develop a 1D GAN from Scratch
Tutorial Overview
Select a One-Dimensional Function
Define a Discriminator Model
Define a Generator Model
Training the Generator Model
Evaluating the Performance of the GAN
Complete Example of Training the GAN
Extensions
Further Reading
Summary
How to Develop a DCGAN for Grayscale Handwritten Digits
Tutorial Overview
MNIST Handwritten Digit Dataset
How to Define and Train the Discriminator Model
How to Define and Use the Generator Model
How to Train the Generator Model
How to Evaluate GAN Model Performance
Complete Example of GAN for MNIST
How to Use the Final Generator Model
Extensions
Further Reading
Summary
How to Develop a DCGAN for Small Color Photographs
Tutorial Overview
CIFAR-10 Small Object Photograph Dataset
How to Define and Train the Discriminator Model
How to Define and Use the Generator Model
How to Train the Generator Model
How to Evaluate GAN Model Performance
Complete Example of GAN for CIFAR-10
How to Use the Final Generator Model
Extensions
Further Reading
Summary
How to Explore the Latent Space When Generating Faces
Tutorial Overview
Vector Arithmetic in Latent Space
Large-Scale CelebFaces Dataset (CelebA)
How to Prepare the CelebA Faces Dataset
How to Develop a GAN for CelebA
How to Explore the Latent Space for Generated Faces
Extensions
Further Reading
Summary
How to Identify and Diagnose GAN Failure Modes
Tutorial Overview
How To Train a Stable GAN
How To Identify a Mode Collapse
How To Identify Convergence Failure
Further Reading
Summary
III GAN Evaluation
How to Evaluate Generative Adversarial Networks
Overview
Problem with Evaluating Generator Models
Manual GAN Generator Evaluation
Qualitative GAN Generator Evaluation
Quantitative GAN Generator Evaluation
Which GAN Evaluation Scheme to Use
Further Reading
Summary
How to Implement the Inception Score
Tutorial Overview
What Is the Inception Score?
How to Calculate the Inception Score
How to Implement the Inception Score With NumPy
How to Implement the Inception Score With Keras
Problems With the Inception Score
Further Reading
Summary
How to Implement the Frechet Inception Distance
Tutorial Overview
What Is the Frechet Inception Distance?
How to Calculate the FID
How to Implement the FID With NumPy
How to Implement the FID With Keras
How to Calculate the FID for Real Images
Further Reading
Summary
IV GAN Loss
How to Use Different GAN Loss Functions
Overview
Challenge of GAN Loss
Standard GAN Loss Functions
Alternate GAN Loss Functions
Effect of Different GAN Loss Functions
Further Reading
Summary
How to Develop a Least Squares GAN (LSGAN)
Tutorial Overview
What Is Least Squares GAN
How to Develop an LSGAN for MNIST
How to Generate Images With LSGAN
Further Reading
Summary
How to Develop a Wasserstein GAN (WGAN)
Tutorial Overview
What Is a Wasserstein GAN?
How to Implement Wasserstein Loss
Wasserstein GAN Implementation Details
How to Train a Wasserstein GAN Model
How to Generate Images With WGAN
Further Reading
Summary
V Conditional GANs
How to Develop a Conditional GAN (cGAN)
Tutorial Overview
Conditional Generative Adversarial Networks
Fashion-MNIST Clothing Photograph Dataset
Unconditional GAN for Fashion-MNIST
Conditional GAN for Fashion-MNIST
Conditional Clothing Generation
Extensions
Further Reading
Summary
How to Develop an Information Maximizing GAN (InfoGAN)
Tutorial Overview
What Is the Information Maximizing GAN
How to Implement the InfoGAN Loss Function
How to Develop an InfoGAN for MNIST
How to Use Control Codes With an InfoGAN
Extensions
Further Reading
Summary
How to Develop an Auxiliary Classifier GAN (AC-GAN)
Tutorial Overview
Auxiliary Classifier Generative Adversarial Networks
Fashion-MNIST Clothing Photograph Dataset
How to Define AC-GAN Models
How to Develop an AC-GAN for Fashion-MNIST
How to Generate Items of Clothing With the AC-GAN
Extensions
Further Reading
Summary
How to Develop a Semi-Supervised GAN (SGAN)
Tutorial Overview
What Is the Semi-Supervised GAN?
How to Implement the Semi-Supervised Discriminator
How to Develop a Semi-Supervised GAN for MNIST
How to Use the Final SGAN Classifier Model
Extensions
Further Reading
Summary
VI Image Translation
Introduction to Pix2Pix
Overview
The Problem of Image-to-Image Translation
Pix2Pix GAN for Image-to-Image Translation
Pix2Pix Architectural Details
Applications of the Pix2Pix GAN
Insight into Pix2Pix Architectural Choices
Further Reading
Summary
How to Implement Pix2Pix Models
Tutorial Overview
What Is the Pix2Pix GAN?
How to Implement the PatchGAN Discriminator Model
How to Implement the U-Net Generator Model
How to Implement Adversarial and L1 Loss
How to Update Model Weights
Further Reading
Summary
How to Develop a Pix2Pix End-to-End
Tutorial Overview
What Is the Pix2Pix GAN?
Satellite to Map Image Translation Dataset
How to Develop and Train a Pix2Pix Model
How to Translate Images With a Pix2Pix Model
How to Translate Google Maps to Satellite Images
Extensions
Further Reading
Summary
Introduction to the CycleGAN
Overview
Problem With Image-to-Image Translation
Unpaired Image-to-Image Translation With CycleGAN
What Is the CycleGAN Model Architecture
Applications of CycleGAN
Implementation Tips for CycleGAN
Further Reading
Summary
How to Implement CycleGAN Models
Tutorial Overview
What Is the CycleGAN Architecture?
How to Implement the CycleGAN Discriminator Model
How to Implement the CycleGAN Generator Model
How to Implement Composite Models and Loss
How to Update Model Weights
Further Reading
Summary
How to Develop the CycleGAN End-to-End
Tutorial Overview
What Is the CycleGAN?
How to Prepare the Horses to Zebras Dataset
How to Develop a CycleGAN to Translate Horse to Zebra
How to Perform Image Translation with CycleGAN
Extensions
Further Reading
Summary
VII Advanced GANs
Introduction to the BigGAN
Overview
Brittleness of GAN Training
Develop Better GANs by Scaling Up
How to Scale-Up GANs With BigGAN
Example of Images Generated by BigGAN
Further Reading
Summary
Introduction to the Progressive Growing GAN
Overview
GANs Are Generally Limited to Small Images
Generate Large Images by Progressively Adding Layers
How to Progressively Grow a GAN
Images Generated by the Progressive Growing GAN
How to Configure Progressive Growing GAN Models
Further Reading
Summary
Introduction to the StyleGAN
Overview
Lacking Control Over Synthesized Images
Control Style Using New Generator Model
What Is the StyleGAN Model Architecture
Examples of StyleGAN Generated Images
Further Reading
Summary
VIII Appendix
Getting Help
Applied Neural Networks
Programming Computer Vision Books
Official Keras Destinations
Where to Get Help with Keras
How to Ask Questions
Contact the Author
How to Setup Python on Your Workstation
Overview
Download Anaconda
Install Anaconda
Start and Update Anaconda
Install Deep Learning Libraries
Further Reading
Summary
How to Setup Amazon EC2 for Deep Learning on GPUs
Overview
Setup Your AWS Account
Launch Your Server Instance
Login, Configure and Run
Build and Run Models on AWS
Close Your EC2 Instance
Tips and Tricks for Using Keras on AWS
Further Reading
Summary
IX Conclusions
How Far You Have Come