how do I implement ssim for loss function in keras?
other choice would be
ssim_loss = 1 - tf.reduce_mean(tf.image.ssim(target, output, max_val=self.max_val))
then
combine_loss = mae (or mse) + ssim_loss
In this way, you are minimizing both of them.
I need SSIM as a loss function in my network, but my network has 2 outputs. I need to use SSIM for first output and cross-entropy for the next. The loss function is a combination of them. However, I need to have a higher SSIM and lower cross-entropy, so I think the combination of them isn't true.  Another problem is that I could not find an implementation of SSIM in keras.
Tensorflow has tf.image.ssim, but it accepts the image and I do not think I can use it in loss function, right? Could you please tell me what should I do? I am a beginner in keras and deep learning and I do not know how can I make SSIM as a custom loss function in keras.