Skip to content
Snippets Groups Projects
Commit 3a136056 authored by Frisinghelli Daniel's avatar Frisinghelli Daniel
Browse files

Corrected expected value of Gamma-Bernoulli distribution.

parent 5a178fe9
No related branches found
No related tags found
No related merge requests found
...@@ -68,10 +68,11 @@ def predict_ERA5(net, ERA5_ds, predictand, batch_size=16, **kwargs): ...@@ -68,10 +68,11 @@ def predict_ERA5(net, ERA5_ds, predictand, batch_size=16, **kwargs):
torch.as_tensor(target[:, 0, ...].squeeze(), torch.as_tensor(target[:, 0, ...].squeeze(),
dtype=torch.float32)).numpy(), dtype=torch.float32)).numpy(),
# amount of precipitation: expected value of gamma distribution # amount of precipitation: expected value of Bernoulli-Gamma
# pr = shape * scale # distribution
'precipitation': (np.exp(target[:, 1, ...]) * # pr = p * shape * scale
np.exp(target[:, 2, ...])).squeeze() 'precipitation': (ds['prob'] * np.exp(target[:, 1, ...].squeeze())
* np.exp(target[:, 2, ...].squeeze()))
} }
else: else:
# single predictand # single predictand
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment