Skip to Main Content
Hands-On Artificial Intelligence for Beginners
book

Hands-On Artificial Intelligence for Beginners

by David Dindi, Patrick D. Smith
October 2018
Beginner content levelBeginner
362 pages
9h 32m
English
Packt Publishing
Content preview from Hands-On Artificial Intelligence for Beginners

Utilizing a VAE

We can construct a variational autoencoder in TensorFlow to see how it compares to it's simpler, standard autoencoder cousin. In this section, we'll be using the same MNIST dataset so that we can standardize our comparison across methods. Let's walk through how to construct a VAE by utilizing it to generate handwriting based on the MNIST dataset. Think of x as being the individual written characters and z as the latent features in each of the individual characters that we are trying to learn.

First, let's start with our imports:

import numpy as npimport tensorflow as tffrom tensorflow.examples.tutorials.mnist import input_data

As before, we can import the 'MNIST_data' directly from the TensorFlow library:

mnist = input_data.read_data_sets('MNIST_data', ...
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

Artificial Intelligence and Machine Learning Fundamentals

Artificial Intelligence and Machine Learning Fundamentals

Zsolt Nagy

Publisher Resources

ISBN: 9781788991063Supplemental Content