Skip to Content
Hands-On Convolutional Neural Networks with TensorFlow
book

Hands-On Convolutional Neural Networks with TensorFlow

by Iffat Zafar, Giounona Tzanidou, Richard Burton, Nimesh Patel, Leonardo Araujo
August 2018
Intermediate to advanced
272 pages
7h 2m
English
Packt Publishing
Content preview from Hands-On Convolutional Neural Networks with TensorFlow

Building a CNN model in TensorFlow

Before we start, there is a bit of good news: using TensorFlow, you don't need to take care about writing backpropagation or gradient descent code and also all common types of layers are already implemented, so things should be easier.

In the TensorFlow example here, we will change things a bit from what you learned in Chapter 1, Setup and Introduction to TensorFlow, and use the tf.layers API to create whole layers of our network with ease:

import tensorflow as tf from tensorflow.examples.tutorials.mnist import input_data mnist = input_data.read_data_sets("MNIST_data/", one_hot=True) # MNIST data input (img shape: 28*28) num_input = 28*28*1 # MNIST total classes (0-9 digits) num_classes = 10 # Define model ...
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

Computer Vision Using Deep Learning: Neural Network Architectures with Python and Keras

Computer Vision Using Deep Learning: Neural Network Architectures with Python and Keras

Vaibhav Verdhan

Publisher Resources

ISBN: 9781789130331Supplemental Content