Why does the Total Variation Loss in Tensorflow suggest to use reduce_sum
instead of reduce_mean
as a loss function?
This can be used as a loss-function during optimization so as to suppress noise in images. If you have a batch of images, then you should calculate the scalar loss-value as the sum:
loss = tf.reduce_sum(tf.image.total_variation(images))
I contacted the author and it seems there wasn't any important reason behind it at all. He mentioned that maybe reduce_sum
worked better for his test case than reduce_mean
but encouraged me to test both cases and choose the one which gives me the best results.
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