I need to calculate the loss from the output of softmax against the target. My goal is like [0,0,1], and the output is [0,3,0,3,0,4] For this purpose, the forecast is correct. But the cost function like below does not take into account such 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 of [0,3,0,3,0,4] to [0,0,1] to TF?
jolly source
share