During training I periodically evaluate my tensorflow network using a modified version of the tensorflow example do_eval() function. My evaluation loss is:
evalLoss = tf.nn.l2_loss(tf.sub(prediction, truthValues_placeholder))
This produces a single scalar loss value. I feed batch truth values in the placeholder via feed_dict.
Thanks in advance.
As tf.nn.l2_loss(t) just returns sum(t ** 2) / 2,
Then get the eachLoss value by run() or eval() method.
eachLoss = tf.sub(prediction, truthValues_placeholder)
evalLoss = tf.nn.l2_loss(eachLoss)
If you love us? You can donate to us via Paypal or buy me a coffee so we can maintain and grow! Thank you!
Donate Us With