Search icon CANCEL
Subscription
0
Cart icon
Your Cart (0 item)
Close icon
You have no products in your basket yet
Arrow left icon
Explore Products
Best Sellers
New Releases
Books
Videos
Audiobooks
Learning Hub
Free Learning
Arrow right icon
Arrow up icon
GO TO TOP
The Deep Learning Workshop

You're reading from   The Deep Learning Workshop Learn the skills you need to develop your own next-generation deep learning models with TensorFlow and Keras

Arrow left icon
Product type Paperback
Published in Jul 2020
Publisher Packt
ISBN-13 9781839219856
Length 474 pages
Edition 1st Edition
Languages
Tools
Arrow right icon
Authors (5):
Arrow left icon
Nipun Sadvilkar Nipun Sadvilkar
Author Profile Icon Nipun Sadvilkar
Nipun Sadvilkar
Thomas Joseph Thomas Joseph
Author Profile Icon Thomas Joseph
Thomas Joseph
Anthony So Anthony So
Author Profile Icon Anthony So
Anthony So
Mohan Kumar Silaparasetty Mohan Kumar Silaparasetty
Author Profile Icon Mohan Kumar Silaparasetty
Mohan Kumar Silaparasetty
Mirza Rahim Baig Mirza Rahim Baig
Author Profile Icon Mirza Rahim Baig
Mirza Rahim Baig
+1 more Show less
Arrow right icon
View More author details
Toc

Table of Contents (9) Chapters Close

Preface
1. Building Blocks of Deep Learning 2. Neural Networks FREE CHAPTER 3. Image Classification with Convolutional Neural Networks (CNNs) 4. Deep Learning for Text – Embeddings 5. Deep Learning for Sequences 6. LSTMs, GRUs, and Advanced RNNs 7. Generative Adversarial Networks Appendix

7. Generative Adversarial Networks

Activity 7.01: Implementing a DCGAN for the MNIST Fashion Dataset

Solution

  1. Open a new Jupyter Notebook and name it Activity 7.01. Import the following library packages:
    # Import the required library functions
    import numpy as np
    import matplotlib.pyplot as plt
    from matplotlib import pyplot
    import tensorflow as tf
    from tensorflow.keras.layers import Input
    from tensorflow.keras.initializers import RandomNormal
    from tensorflow.keras.models import Model, Sequential
    from tensorflow.keras.layers \
    import Reshape, Dense, Dropout, Flatten,Activation
    from tensorflow.keras.layers import LeakyReLU,BatchNormalization
    from tensorflow.keras.layers import Conv2D, UpSampling2D,Conv2DTranspose
    from tensorflow.keras.datasets import fashion_mnist
    from tensorflow.keras.optimizers import Adam
  2. Create a function that will generate real data samples from the fashion MNIST data:
    # Function to generate real data samples
    def realData(batch):
       ...
lock icon The rest of the chapter is locked
arrow left Previous Section
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
Banner background image