I need to calculate loss from the softmax output vs target. My target is like [0,0,1] and output is [0.3,0.3,0.4] For the purpose, prediction is correct. But a cost function of below type doesn't account for this kind of accuracy
self._output = output = tf.nn.softmax(y)
self._cost = cost = tf.reduce_mean(tf.square( output - tf.reshape(self._targets, [-1])))
How can I easily convert the output [0.3,0.3,0.4] to [0,0,1] in TF itself?