Skip to content

Instantly share code, notes, and snippets.

Embed
What would you like to do?
#We flatten the last layer (pool2) and multiply it by a set of weights to produce 10 logits
shape = pool2.shape.as_list()
fc = shape[1] * shape[2] * shape[3] #7x7x256 = 6,272
reshape = tf.reshape(pool2, [-1, fc])
fc_weights = tf.Variable(tf.random_normal([fc, 10])) #6,272x10
fc_bias = tf.Variable(tf.zeros([10])) #10
#Logits are ten numbers
logits = tf.matmul(reshape, fc_weights) + fc_bias #10
#Predictions are ten numbers that are scaled to add to 1.00
predictions = tf.nn.softmax(logits) #10
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment