From c556e440d6e94dd6e978a74351ba37a53efafa07 Mon Sep 17 00:00:00 2001 From: tomrink <rink@ssec.wisc.edu> Date: Fri, 6 Oct 2023 10:00:17 -0500 Subject: [PATCH] snapshot... --- modules/GSOC/E2_ESRGAN/lib/utils.py | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/modules/GSOC/E2_ESRGAN/lib/utils.py b/modules/GSOC/E2_ESRGAN/lib/utils.py index f724c3d2..99d463d6 100644 --- a/modules/GSOC/E2_ESRGAN/lib/utils.py +++ b/modules/GSOC/E2_ESRGAN/lib/utils.py @@ -164,6 +164,12 @@ def pixel_loss(y_true, y_pred): return tf.reduce_mean(tf.reduce_mean(tf.abs(y_true - y_pred), axis=0)) +def pixel_loss_mse(y_true, y_pred): + y_true = tf.cast(y_true, tf.float32) + y_pred = tf.cast(y_pred, tf.float32) + return tf.reduce_mean(tf.reduce_mean(tf.square(y_true - y_pred), axis=0)) + + def RelativisticAverageLoss(non_transformed_disc, type_="G"): """ Relativistic Average Loss based on RaGAN Args: -- GitLab