I want to use SSIM metric as my loss function for the model I\'m working on in tensorflow. SSIM should measure the similarity between my re
I was capable of solving the issue by changing the dynamic range of the images to 2.0, since I have images scaled between [-1, 1] by:
loss_rec = tf.reduce_mean(tf.image.ssim(truth, reconstructed, 2.0))
And since a better image quality is shown by a higher SSIM value, I had to minimize the negative of my loss function (SSIM) to optimize my model:
optimizer = tf.train.AdamOptimizer(learning_rate).minimize(-1 * loss_rec)