Notice code in file: https://github.com/GoogleCloudPlatform/tensorflow-without-a-phd/blob/master/tensorflow-mnist-tutorial/mnist_1.0_softmax.py
# cross-entropy # log takes the log of each element, * multiplies the tensors element by element # reduce_mean will add all the components in the tensor # so here we end up with the total cross-entropy for all images in the batch cross_entropy = -tf.reduce_mean(Y_ * tf.log(Y)) * 1000.0 # normalized for batches of 100 images, # *10 because "mean" included an unwa ... ...
{{item.post.textarea}}
墨之科技,版权所有 © Copyright 2017-2027
湘ICP备14012786号 邮箱:ai@inksci.com