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

Change filenames for precipitation.

parent cef17c0e
No related branches found
No related tags found
No related merge requests found
......@@ -93,8 +93,7 @@ FILTERS = [32, 64, 128, 256]
# for temperature: L1Loss or MSELoss (NLL of normal distribution)
# for precipitation: BernoulliGammaLoss (NLL of Bernoulli-Gamma distribution)
LOSS = MSELoss()
if PREDICTAND == 'pr':
LOSS = BernoulliGammaLoss(min_amount=WET_DAY_THRESHOLD)
# LOSS = BernoulliGammaLoss(min_amount=0)
# whether to randomly shuffle time steps or to conserve time series for model
# training
......
......@@ -45,8 +45,13 @@ if __name__ == '__main__':
# adjust statefile name for precipitation
if PREDICTAND == 'pr':
state_file = state_file.replace('.pt', '_{:0d}mm_{}.pt'.format(
WET_DAY_THRESHOLD, repr(LOSS).strip('()')))
if isinstance(LOSS, BernoulliGammaLoss):
state_file = state_file.replace('.pt', '_{}mm_{}.pt'.format(
str(LOSS.min_amount).replace('.', ''),
repr(LOSS).strip('()')))
else:
state_file = state_file.replace('.pt', '{}.pt'.format(
repr(LOSS).strip('()')))
# path to model state
state_file = MODEL_PATH.joinpath(state_file)
......
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