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 Cookbook

You're reading from  Generative Adversarial Networks Cookbook

Product type Book
Published in Dec 2018
Publisher Packt
ISBN-13 9781789139907
Pages 268 pages
Edition 1st Edition
Languages
Author (1):
Josh Kalin Josh Kalin
Profile icon Josh Kalin

Table of Contents (17) Chapters

Title Page
Copyright and Credits
About Packt
Dedication
Contributors
Preface
Dedication2
1. What Is a Generative Adversarial Network? 2. Data First, Easy Environment, and Data Prep 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 1. Other Books You May Enjoy Index

Code implementation – GAN


Building the GAN is a core step with every one of these architectures—we have to be somewhat careful with CycleGAN because it's one of the first times we are going to develop a multilevel model. The GAN model will have six models in adversarial training mode—let's build it!

Getting ready

Every recipe is going to demonstrate the structure that you should have in your directory. This ensures that you've got the right files at each step of the way:

├── data
│   ├── 
├── docker
│   ├── build.sh
│   ├── clean.sh
│   └── Dockerfile
├── README.md
├── run.sh
├── scripts
│   └── create_data.sh
├── src
│   ├── generator.py
│   ├── discriminator.py
│   ├── gan.py

How to do it...

The code is quite simple but the power of Keras really shines here—we are able to place six separate models into adversarial training in under 50 lines of code.

These are the steps for this:

  1. Make sure to get your imports for the implementation phase of the code:
#!/usr/bin/env python3
import sys
import numpy...
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 $15.99/month. Cancel anytime}