Skip to content

Commit 293f545

Browse files
committed
small updates for consistency
1 parent 17319ea commit 293f545

File tree

16 files changed

+150
-344
lines changed

16 files changed

+150
-344
lines changed

.gitignore

Lines changed: 0 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -182,16 +182,6 @@ archive/
182182
validation/
183183

184184

185-
# Non-public config files
186-
# deltaModel/conf/*
187-
# !deltaModel/conf/config.yaml
188-
# !deltaModel/conf/config.py
189-
# !deltaModel/conf/hydra
190-
# !deltaModel/conf/observations
191-
# deltaModel/conf/observations/*
192-
# !deltaModel/conf/observations/none.yaml
193-
194-
195185
# Usage-specific additions: (Only track base/example files)
196186
# deltaModel/trainers/
197187
# deltaModel/models/physics_models/

deltaModel/conf/config.py

Lines changed: 0 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -25,17 +25,6 @@ def check_path(v: str) -> Path:
2525
return path
2626

2727

28-
class InitalizationEnum(str, Enum):
29-
kaiming_normal = "kaiming_normal"
30-
kaiming_uniform = "kaiming_uniform"
31-
orthogonal = "orthogonal"
32-
sparse = "sparse"
33-
trunc_normal = "trunc_normal"
34-
xavier_normal = "xavier_normal"
35-
xavier_uniform = "xavier_uniform"
36-
default = "default"
37-
38-
3928
class ModeEnum(str, Enum):
4029
train = 'train'
4130
test = 'test'

deltaModel/conf/observations/camels_531.yaml

Lines changed: 0 additions & 53 deletions
This file was deleted.

deltaModel/conf/observations/camels_671.yaml

Lines changed: 0 additions & 52 deletions
This file was deleted.

deltaModel/conf/observations/merit_forward.yaml

Lines changed: 0 additions & 49 deletions
This file was deleted.

deltaModel/conf/observations/prism_531.yaml

Lines changed: 0 additions & 53 deletions
This file was deleted.

deltaModel/conf/observations/prism_671.yaml

Lines changed: 0 additions & 52 deletions
This file was deleted.

deltaModel/core/data/data_loaders/loader_hydro.py

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -350,6 +350,7 @@ def _get_basin_area(self, c_nn: np.ndarray) -> np.ndarray:
350350

351351
def normalize(self, x_nn: np.ndarray, c_nn: np.ndarray) -> np.ndarray:
352352
"""Normalize data for neural network."""
353+
# TODO: Add np.swapaxes(x_nn, 1, 0) here and remove from _to_norm. This changes normalization, need to determine if it's detrimental.
353354
x_nn_norm = self._to_norm(
354355
np.swapaxes(x_nn, 1, 0).copy(),
355356
self.nn_forcings,
@@ -391,11 +392,12 @@ def _to_norm(self, data: np.ndarray, vars: List[str]) -> np.ndarray:
391392
data_norm[:, k] = (data[:, k] - stat[2]) / stat[3]
392393
else:
393394
raise DataDimensionalityWarning("Data dimension must be 2 or 3.")
394-
395+
396+
# Should be external, except altering order of first two dims augments normalization.
395397
if len(data_norm.shape) < 3:
396398
return data_norm
397399
else:
398-
return np.swapaxes(data_norm, 1, 0) ##TODO move to outside of _to_norm
400+
return np.swapaxes(data_norm, 1, 0)
399401

400402
def _from_norm(self, data_norm: np.ndarray, vars: List[str]) -> np.ndarray:
401403
"""De-normalize data."""

deltaModel/core/data/data_loaders/loader_hydro_ms.py

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -24,6 +24,8 @@ class HydroMSDataLoader(BaseDataLoader):
2424
Configuration dictionary.
2525
test_split : bool, optional
2626
Whether to split data into training and testing sets. Default is False.
27+
overwrite : bool, optional
28+
Whether to overwrite existing normalization statistics. Default is False.
2729
"""
2830
def __init__(
2931
self,

deltaModel/core/utils/__init__.py

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -133,6 +133,9 @@ def initialize_config(config: Union[DictConfig, dict]) -> Dict[str, Any]:
133133
if config['dpl_model']['nn_model'].get('lr_scheduler', '') in ['none', 'None', '']:
134134
config['dpl_model']['nn_model']['lr_scheduler'] = None
135135

136+
if config.get('trained_model', '') in ['none', 'None', '']:
137+
config['trained_model'] = ''
138+
136139
# Create output directories and add path to config.
137140
out_path = PathBuilder(config)
138141
config = out_path.write_path(config)

0 commit comments

Comments
 (0)