Search icon
Arrow left icon
All Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Newsletters
Free Learning
Arrow right icon
Generative Adversarial Networks Projects

You're reading from  Generative Adversarial Networks Projects

Product type Book
Published in Jan 2019
Publisher Packt
ISBN-13 9781789136678
Pages 316 pages
Edition 1st Edition
Languages
Author (1):
Kailash Ahirwar Kailash Ahirwar
Profile icon Kailash Ahirwar

Table of Contents (11) Chapters

Preface 1. Introduction to Generative Adversarial Networks 2. 3D-GAN - Generating Shapes Using GANs 3. Face Aging Using Conditional GAN 4. Generating Anime Characters Using DCGANs 5. Using SRGANs to Generate Photo-Realistic Images 6. StackGAN - Text to Photo-Realistic Image Synthesis 7. CycleGAN - Turn Paintings into Photos 8. Conditional GAN - Image-to-Image Translation Using Conditional Adversarial Networks 9. Predicting the Future of GANs 10. Other Books You May Enjoy

Training the pix2pix network

Like any other GAN, training the pix2pix network is a two-step process. In the first step, we train the discriminator network. In the second step, we train the adversarial network, which eventually trains the generator network. Let's start training the network.

Perform the following steps to train an SRGAN network:

  1. Start by defining the hyperparameters that are required for training:
epochs = 500
num_images_per_epoch = 400
batch_size = 1
img_width = 256
img_height = 256
num_channels = 1
input_img_dim = (256, 256, 1)
patch_dim = (256, 256)

# Specify dataset directory path
dataset_dir = "pix2pix-keras/pix2pix/data/facades_bw"
  1. Next, define the common optimizer, shown as follows:
common_optimizer = Adam(lr=1E-4, beta_1=0.9, beta_2=0.999,  
epsilon=1e-08)

For all networks, we will use the Adam optimizer with the learning...

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 €14.99/month. Cancel anytime}