Logo Questions Linux Laravel Mysql Ubuntu Git Menu
 

Tensorflow - Total Variation Loss - reduce_sum vs reduce_mean?

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))

like image 583
Cypher Avatar asked Dec 02 '17 06:12

Cypher


1 Answers

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.

like image 178
Cypher Avatar answered Nov 15 '22 08:11

Cypher