Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
C
Climax
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
earth_observation_public
Climax
Commits
970832cd
Commit
970832cd
authored
3 years ago
by
Frisinghelli Daniel
Browse files
Options
Downloads
Patches
Plain Diff
LR-scheduler to statefile.
parent
50232ca4
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
climax/core/dataset.py
+5
-1
5 additions, 1 deletion
climax/core/dataset.py
climax/main/downscale_infer.py
+3
-2
3 additions, 2 deletions
climax/main/downscale_infer.py
climax/main/downscale_train.py
+2
-1
2 additions, 1 deletion
climax/main/downscale_train.py
with
10 additions
and
4 deletions
climax/core/dataset.py
+
5
−
1
View file @
970832cd
...
...
@@ -113,7 +113,7 @@ class EoDataset(torch.utils.data.Dataset):
def
state_file
(
model
,
predictand
,
predictors
,
plevels
,
dem
=
False
,
dem_features
=
False
,
doy
=
False
,
loss
=
None
,
cv
=
None
,
season
=
None
,
anomalies
=
False
,
decay
=
None
,
optim
=
None
,
lr
=
None
):
lr
=
None
,
lr_scheduler
=
None
):
# naming convention:
# <model>_<predictand>_<Ppredictors>_<plevels>_<Spredictors>.pt
...
...
@@ -155,6 +155,10 @@ class EoDataset(torch.utils.data.Dataset):
state_file
=
(
'
_
'
.
join
([
state_file
,
'
lr{:.0e}
'
.
format
(
lr
)])
if
lr
is
not
None
else
state_file
)
# add suffix for learning rate scheduler
state_file
=
(
'
_
'
.
join
([
state_file
,
lr_scheduler
.
__name__
])
if
lr_scheduler
is
not
None
else
state_file
)
# add suffix for training with anomalies
state_file
=
(
'
_
'
.
join
([
state_file
,
'
anom
'
])
if
anomalies
else
state_file
)
...
...
This diff is collapsed.
Click to expand it.
climax/main/downscale_infer.py
+
3
−
2
View file @
970832cd
...
...
@@ -24,7 +24,7 @@ from climax.core.utils import split_date_range
from
climax.main.config
import
(
ERA5_PREDICTORS
,
ERA5_PLEVELS
,
PREDICTAND
,
NET
,
VALID_PERIOD
,
BATCH_SIZE
,
NORM
,
DOY
,
NYEARS
,
DEM
,
DEM_FEATURES
,
LOSS
,
ANOMALIES
,
OPTIM
,
OPTIM_PARAMS
,
CHUNKS
)
OPTIM_PARAMS
,
CHUNKS
,
LR_SCHEDULER
)
from
climax.main.io
import
ERA5_PATH
,
DEM_PATH
,
MODEL_PATH
,
TARGET_PATH
# module level logger
...
...
@@ -40,7 +40,8 @@ if __name__ == '__main__':
state_file
=
ERA5Dataset
.
state_file
(
NET
,
PREDICTAND
,
ERA5_PREDICTORS
,
ERA5_PLEVELS
,
dem
=
DEM
,
dem_features
=
DEM_FEATURES
,
doy
=
DOY
,
loss
=
LOSS
,
anomalies
=
ANOMALIES
,
decay
=
OPTIM_PARAMS
[
'
weight_decay
'
],
optim
=
OPTIM
,
lr
=
OPTIM_PARAMS
[
'
lr
'
])
decay
=
OPTIM_PARAMS
[
'
weight_decay
'
],
optim
=
OPTIM
,
lr
=
OPTIM_PARAMS
[
'
lr
'
],
lr_scheduler
=
LR_SCHEDULER
)
# path to model state
state_file
=
MODEL_PATH
.
joinpath
(
PREDICTAND
,
state_file
)
...
...
This diff is collapsed.
Click to expand it.
climax/main/downscale_train.py
+
2
−
1
View file @
970832cd
...
...
@@ -44,7 +44,8 @@ if __name__ == '__main__':
state_file
=
ERA5Dataset
.
state_file
(
NET
,
PREDICTAND
,
ERA5_PREDICTORS
,
ERA5_PLEVELS
,
dem
=
DEM
,
dem_features
=
DEM_FEATURES
,
doy
=
DOY
,
loss
=
LOSS
,
anomalies
=
ANOMALIES
,
decay
=
OPTIM_PARAMS
[
'
weight_decay
'
],
optim
=
OPTIM
,
lr
=
OPTIM_PARAMS
[
'
lr
'
])
decay
=
OPTIM_PARAMS
[
'
weight_decay
'
],
optim
=
OPTIM
,
lr
=
OPTIM_PARAMS
[
'
lr
'
],
lr_scheduler
=
LR_SCHEDULER
)
# path to model state
state_file
=
MODEL_PATH
.
joinpath
(
PREDICTAND
,
state_file
)
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment