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

Code

Next, we present the function responsible for building the VGG-16 model graph in Tensorflow. VGGNet, like all the models in this chapter, was designed to classify the 1,000 classes of the Imagenet challenge, which is why this model outputs a vector of size 1,000. Obviously, this can be easily changed for your own datasets, as follows:

 def build_graph(self): self.__x_ = tf.placeholder("float", shape=[None, 224, 224, 3], name='X') self.__y_ = tf.placeholder("float", shape=[None, 1000], name='Y') with tf.name_scope("model") as scope: conv1_1 = tf.layers.conv2d(inputs=self.__x_, filters=64, kernel_size=[3, 3], padding="same", activation=tf.nn.relu) conv2_1 = tf.layers.conv2d(inputs=conv1_1, filters=64, kernel_size=[3, 3], padding="same", ...
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