Search icon CANCEL
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Conferences
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
Generative Adversarial Networks Cookbook

You're reading from   Generative Adversarial Networks Cookbook Over 100 recipes to build generative models using Python, TensorFlow, and Keras

Arrow left icon
Product type Paperback
Published in Dec 2018
Publisher Packt
ISBN-13 9781789139907
Length 268 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Author (1):
Arrow left icon
Josh Kalin Josh Kalin
Author Profile Icon Josh Kalin
Josh Kalin
Arrow right icon
View More author details
Toc

Table of Contents (10) Chapters Close

Preface 1. What Is a Generative Adversarial Network? 2. Data First, Easy Environment, and Data Prep FREE CHAPTER 3. My First GAN in Under 100 Lines 4. Dreaming of New Outdoor Structures Using DCGAN 5. Pix2Pix Image-to-Image Translation 6. Style Transfering Your Image Using CycleGAN 7. Using Simulated Images To Create Photo-Realistic Eyeballs with SimGAN 8. From Image to 3D Models Using GANs 9. Other Books You May Enjoy

Pseudocode – how does it work?


With every technique, we need to understand the baseline algorithm before we can lay down any code. So, in this section, we'll discuss how the training algorithm works.

Getting ready

In this section, we'll be referring to the SimGAN paper once again.

How to do it...

In the SimGAN paper, the authors provided a convenient graphic for users to base their development on. We already know that we need to develop models for each of the networks, but how do we train a network in the first place? The following diagram offers an explanation:

Algorithm 

Let's convert the preceding diagram into the following, tangible steps:

  1. Read both synthetic images and real images into variables.
  2. Then, for every epoch, do the following:
    • Train the refiner networks on a random mini batch for K_Gtimes
    • Train the discriminator network on a random mini batch for K_D times
  3. Stop when the number of epochs reached, or lost, has not changed significantly for nepochs.

 

lock icon The rest of the chapter is locked
Register for a free Packt account to unlock a world of extra content!
A free Packt account unlocks extra newsletters, articles, discounted offers, and much more. Start advancing your knowledge today.
Unlock this book and the full library FREE for 7 days
Get unlimited access to 7000+ expert-authored eBooks and videos courses covering every tech area you can think of
Renews at €18.99/month. Cancel anytime