diff --git a/climax/core/loss.py b/climax/core/loss.py index 5eb2fd5bd7c5900c35d67b2aa01afe5e0f06a53b..8895ab177a64c54ac1e4cd72f48f071f1def4deb 100644 --- a/climax/core/loss.py +++ b/climax/core/loss.py @@ -108,7 +108,7 @@ class BernoulliGammaLoss(BernoulliLoss): @staticmethod def predict(p, shape, scale): # pr = p * shape * scale - return p * shape * scale + return p * np.exp(shape) * np.exp(scale) class BernoulliGenParetoLoss(BernoulliLoss): @@ -219,4 +219,4 @@ class BernoulliWeibullLoss(BernoulliLoss): @staticmethod def predict(p, shape, scale): # pr = p * scale * gamma(1 + 1 / shape) - return p * scale * gamma(1 + 1 / shape) + return p * np.exp(scale) * gamma(1 + 1 / np.exp(shape)) diff --git a/climax/core/predict.py b/climax/core/predict.py index af1e38b41ce4d31a4cace554611da772f6c0ffb5..bbefa411878b8d7eb2a92ea0d764bb8948aca266 100644 --- a/climax/core/predict.py +++ b/climax/core/predict.py @@ -75,8 +75,8 @@ def predict_ERA5(net, ERA5_ds, predictand, loss, batch_size=16, **kwargs): dtype=torch.float32)).numpy() # shape and scale parameters - shape = np.exp(target[:, 1, ...].squeeze()) - scale = np.exp(target[:, 2, ...].squeeze()) + shape = target[:, 1, ...].squeeze() + scale = target[:, 2, ...].squeeze() # precipitation amount pr = loss.predict(prob, shape, scale)