Created
February 17, 2018 18:16
-
-
Save JoshVarty/86accd010b2c1fb504b22b4acd54c1b2 to your computer and use it in GitHub Desktop.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
#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