Skip to Content
Hands-On Unsupervised Learning with Python
book

Hands-On Unsupervised Learning with Python

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

Example of a deep convolutional autoencoder

Let's implement a deep convolutional autoencoder based on TensorFlow and the Olivetti faces dataset (which is relatively small, but offers a good level of expressivity). Let's start by loading the images and preparing the training set:

from sklearn.datasets import fetch_olivetti_facesfaces = fetch_olivetti_faces(shuffle=True, random_state=1000)X_train = faces['images']

The samples are 400, 64 × 64 grayscale images that we are going to resize to 32 × 32, in order to speed up computation and avoid memory issues (this operation will cause a slight loss of visual precision, and you can remove it if you have enough computational resources). We can now define the main constants (the number of epochs ( ...

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