Closed wichersn closed 7 years ago
Good point! I use softmax often to display results in an interpretable way so I used it here as well out of habit. But, indeed, I'm not even printing the values after the softmax here so it's not necessary. I'll make the update.
I attended your Traffic Sign Recognition with TensorFlow talk yesterday, thanks for the presentation.
I have a small tip for you to simplify the neural network in your example further. Currently, you're passing the output from the softmax into
tf.argmax
. The softmax part is unnecessary though, since the maximum value stays the same no matter if softmax is used or not. So you can remove the softmax line and usepredicted_labels = tf.argmax(logits, 1)
. This model will perform the same as the original. Also you can run the following example to see that the softmax doesn't effect the result of argmax:Note that even with this change, your model still uses softmax in the
sparse_softmax_cross_entropy_with_logits
function. See the documentation for it here.