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

Updated state file name.

parent 74f2f0a5
No related branches found
No related tags found
No related merge requests found
......@@ -21,9 +21,10 @@ from pysegcnn.core.utils import search_files
from climax.core.dataset import ERA5Dataset
from climax.core.predict import predict_ERA5
from climax.core.utils import split_date_range
from climax.core.loss import BernoulliGammaLoss
from climax.main.config import (ERA5_PREDICTORS, ERA5_PLEVELS, PREDICTAND, NET,
VALID_PERIOD, BATCH_SIZE, NORM, DOY, NYEARS,
DEM, DEM_FEATURES)
DEM, DEM_FEATURES, LOSS)
from climax.main.io import ERA5_PATH, DEM_PATH, MODEL_PATH, TARGET_PATH
# module level logger
......@@ -39,6 +40,18 @@ if __name__ == '__main__':
state_file = ERA5Dataset.state_file(
NET, PREDICTAND, ERA5_PREDICTORS, ERA5_PLEVELS, dem=DEM,
dem_features=DEM_FEATURES, doy=DOY)
# adjust statefile name for precipitation
if PREDICTAND == 'pr':
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)
# initialize logging
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment