Skip to Main Content
Hands-On Unsupervised Learning with Python
book

Hands-On Unsupervised Learning with Python

by Giuseppe Bonaccorso
February 2019
Intermediate to advanced content levelIntermediate to advanced
386 pages
9h 54m
English
Packt Publishing
Content preview from Hands-On Unsupervised Learning with Python

Transforming the DCGAN into a WGAN

In this example, we will implement a DCGAN based on the Wasserstein distance, using the Fashion MNIST dataset (as provided directly by Keras). This set is made up of 60,000 28 × 28 grayscale images of clothes, and it was introduced by Zalando as a replacement for the standard MNIST dataset, whose classes are too easy to separate with many classifiers. Considering the training time required by this kind of network, we have decided to limit the process to 5,000 samples, but a reader with enough resources can choose to increase or remove this constraint.

The first step consists of loading, slicing, and normalizing the dataset (in the range (-1, 1)), as follows:

import numpy as npfrom keras.datasets import fashion_mnist ...
Become an O’Reilly member and get unlimited access to this title plus top books and audiobooks from O’Reilly and nearly 200 top publishers, thousands of courses curated by job role, 150+ live events each month,
and much more.
Start your free trial

You might also like

Hands-On Unsupervised Learning Using Python

Hands-On Unsupervised Learning Using Python

Ankur A. Patel
Introduction to Machine Learning with Python

Introduction to Machine Learning with Python

Andreas C. Müller, Sarah Guido

Publisher Resources

ISBN: 9781789348279Supplemental Content