From 8dd2cdec7f3d32c74849d4e61c5c33ae4def3386 Mon Sep 17 00:00:00 2001
From: "Daniel.Frisinghelli" <daniel.frisinghelli@eurac.edu>
Date: Wed, 6 Oct 2021 12:13:19 +0200
Subject: [PATCH] Pass loss function to predict.

---
 climax/main/downscale_infer.py        | 5 +++--
 climax/main/downscale_infer_season.py | 5 +++--
 2 files changed, 6 insertions(+), 4 deletions(-)

diff --git a/climax/main/downscale_infer.py b/climax/main/downscale_infer.py
index dac64d1..1093b0c 100644
--- a/climax/main/downscale_infer.py
+++ b/climax/main/downscale_infer.py
@@ -91,8 +91,9 @@ if __name__ == '__main__':
         LogConfig.init_log('Predicting period: {}'.format(
             ' - '.join([str(dates[0]), str(dates[-1])])))
         ref_ds = Era5_ds.sel(time=dates)
-        trg_ds.append(predict_ERA5(net, ref_ds, PREDICTAND, normalize=NORM,
-                                   batch_size=BATCH_SIZE, doy=DOY))
+        trg_ds.append(predict_ERA5(net, ref_ds, PREDICTAND, LOSS,
+                                   normalize=NORM, batch_size=BATCH_SIZE,
+                                   doy=DOY))
 
     # merge predictions for entire validation period
     LOGGER.info('Merging reference periods ...')
diff --git a/climax/main/downscale_infer_season.py b/climax/main/downscale_infer_season.py
index 6173420..76c8441 100644
--- a/climax/main/downscale_infer_season.py
+++ b/climax/main/downscale_infer_season.py
@@ -99,8 +99,9 @@ if __name__ == '__main__':
         predictors = Era5_ds.isel(time=v)
 
         # predict current season
-        predictand = predict_ERA5(net, predictors, PREDICTAND, normalize=NORM,
-                                  batch_size=BATCH_SIZE, doy=DOY)
+        predictand = predict_ERA5(net, predictors, PREDICTAND,LOSS,
+                                  normalize=NORM, batch_size=BATCH_SIZE,
+                                  doy=DOY)
 
         # append prediction to target dataset
         trg_ds.append(predictand)
-- 
GitLab