Model building and training

So, let's start off by specifying the input placeholder variables that will be fed to our neural network model. The shape of the first input variable (which will contain the extracted transfer values) will be [None, transfer_len]. The second placeholder variable will hold the actual class labels of the training set in a one-hot vector format:

transferValues_arrLength = inception_model.transfer_leninput_values = tf.placeholder(tf.float32, shape=[None, transferValues_arrLength], name='input_values')y_actual = tf.placeholder(tf.float32, shape=[None, num_classes], name='y_actual')

We can also get the corresponding integer value of each class from 1 to 10 by defining another placeholder variable:

y_actual_cls = ...

Get Deep Learning By Example now with the O’Reilly learning platform.

O’Reilly members experience books, live events, courses curated by job role, and more from O’Reilly and nearly 200 top publishers.