Reader small image

You're reading from  Generative Adversarial Networks Cookbook

Product typeBook
Published inDec 2018
PublisherPackt
ISBN-139781789139907
Edition1st Edition
Right arrow
Author (1)
Josh Kalin
Josh Kalin
author image
Josh Kalin

Josh Kalin is a Physicist and Technologist focused on the intersection of robotics and machine learning. Josh works on advanced sensors, industrial robotics, machine learning, and automated vehicle research projects. Josh holds degrees in Physics, Mechanical Engineering, and Computer Science. In his free time, he enjoys working on cars (has owned 36 vehicles and counting), building computers, and learning new techniques in robotics and machine learning (like writing this book).
Read more about Josh Kalin

Right arrow

Code implementation – generator


The generator represents the part of the network that will generate new images based on the input sample given to it. In our case, we'll be giving input from an encoded version of an image and it will produce a 16 x 16 x 16 x 3 representation of an object (height by width by length with a color).

Getting ready

We've built out the docker folder and the encoding code and now we're moving to create the generator. In the src folder, create a file called generator.py and make sure you have the same files and folders in your directory:

├── data
├── docker
│   ├── build.sh
│   ├── clean.sh
│   ├── Dockerfile
│   └── kaggle.json
├── out
├── README.md
├── run_autoencoder.sh
└── src
    ├── encoder_model.h5
    ├── encoder.py
    ├── generator.py
    ├── x_test_encoded.npy
    └── x_train_encoded.npy

How to do it...

There are three basic pieces to creating the generator class—the preparation, the model, and the helper functions. We'll cover each in detail throughout this...

lock icon
The rest of the page is locked
Previous PageNext Page
You have been reading a chapter from
Generative Adversarial Networks Cookbook
Published in: Dec 2018Publisher: PacktISBN-13: 9781789139907

Author (1)

author image
Josh Kalin

Josh Kalin is a Physicist and Technologist focused on the intersection of robotics and machine learning. Josh works on advanced sensors, industrial robotics, machine learning, and automated vehicle research projects. Josh holds degrees in Physics, Mechanical Engineering, and Computer Science. In his free time, he enjoys working on cars (has owned 36 vehicles and counting), building computers, and learning new techniques in robotics and machine learning (like writing this book).
Read more about Josh Kalin