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
TensorFlow Deep Learning Projects

You're reading from   TensorFlow Deep Learning Projects 10 real-world projects on computer vision, machine translation, chatbots, and reinforcement learning

Arrow left icon
Product type Paperback
Published in Mar 2018
Publisher Packt
ISBN-13 9781788398060
Length 320 pages
Edition 1st Edition
Languages
Concepts
Arrow right icon
Authors (5):
Arrow left icon
Alberto Boschetti Alberto Boschetti
Author Profile Icon Alberto Boschetti
Alberto Boschetti
Rajalingappaa Shanmugamani Rajalingappaa Shanmugamani
Author Profile Icon Rajalingappaa Shanmugamani
Rajalingappaa Shanmugamani
Luca Massaron Luca Massaron
Author Profile Icon Luca Massaron
Luca Massaron
Abhishek Thakur Abhishek Thakur
Author Profile Icon Abhishek Thakur
Abhishek Thakur
Alexey Grigorev Alexey Grigorev
Author Profile Icon Alexey Grigorev
Alexey Grigorev
+1 more Show less
Arrow right icon
View More author details
Toc

Table of Contents (12) Chapters Close

Preface 1. Recognizing traffic signs using Convnets FREE CHAPTER 2. Annotating Images with Object Detection API 3. Caption Generation for Images 4. Building GANs for Conditional Image Creation 5. Stock Price Prediction with LSTM 6. Create and Train Machine Translation Systems 7. Train and Set up a Chatbot, Able to Discuss Like a Human 8. Detecting Duplicate Quora Questions 9. Building a TensorFlow Recommender System 10. Video Games by Reinforcement Learning 11. Other Books You May Enjoy

Putting CGAN to work on some examples

Now that the CGAN class is completed, let's go through some examples in order to provide you with fresh ideas on how to use this project. First of all, we will have to get everything ready for both downloading the necessary data and training our GAN. We start by importing the routine libraries:

import numpy as np
import urllib.request
import tarfile
import os
import zipfile
import gzip
import os
from glob import glob
from tqdm import tqdm

We then proceed by loading in the dataset and CGAN classes that we previously prepared:

from cGAN import Dataset, CGAN

The class TqdmUpTo is just a tqdm wrapper that enables the use of the progress display also for downloads. The class has been taken directly from the project's page at https://github.com/tqdm/tqdm:

class TqdmUpTo(tqdm):
"""
Provides `update_to(n)` which uses `tqdm.update...
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 $19.99/month. Cancel anytime