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
711f04c3
Commit
711f04c3
authored
3 years ago
by
Frisinghelli Daniel
Browse files
Options
Downloads
Patches
Plain Diff
Implemented CyclicLR schedule.
parent
f15763b2
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
climax/main/config.py
+23
-16
23 additions, 16 deletions
climax/main/config.py
with
23 additions
and
16 deletions
climax/main/config.py
+
23
−
16
View file @
711f04c3
...
...
@@ -24,12 +24,14 @@ from climax.core.loss import (BernoulliGammaLoss, MSELoss, L1Loss,
# ERA5 predictor variables on pressure levels
ERA5_P_PREDICTORS
=
[
'
geopotential
'
,
'
temperature
'
,
'
u_component_of_wind
'
,
'
v_component_of_wind
'
,
'
specific_humidity
'
]
# ERA5_P_PREDICTORS = []
assert
all
([
var
in
ERA5_P_VARIABLES
for
var
in
ERA5_P_PREDICTORS
])
# ERA5 predictor variables on single levels
# ERA5_S_PREDICTORS = ['mean_sea_level_pressure', 'orography', '2m_temperature']
# ERA5_S_PREDICTORS = ['mean_sea_level_pressure']
ERA5_S_PREDICTORS
=
[
'
surface_pressure
'
]
# ERA5_S_PREDICTORS = ['total_precipitation']
assert
all
([
var
in
ERA5_S_VARIABLES
for
var
in
ERA5_S_PREDICTORS
])
# ERA5 predictor variables
...
...
@@ -83,8 +85,8 @@ REFERENCE_PERIOD = np.concatenate([CALIB_PERIOD, VALID_PERIOD], axis=0)
STRATIFY
=
False
# size of the validation set w.r.t. the training set
# e.g., VALID_SIZE = 0.
1
means:
9
0% of CALIB_PERIOD for training
#
1
0% of CALIB_PERIOD for validation
# e.g., VALID_SIZE = 0.
2
means:
8
0% of CALIB_PERIOD for training
#
2
0% of CALIB_PERIOD for validation
VALID_SIZE
=
0.2
# number of folds for training with KFold cross-validation
...
...
@@ -117,23 +119,31 @@ FILTERS = [32, 64, 128, 256]
# BernoulliGammaLoss (NLL of Bernoulli-Gamma distribution)
# BernoulliWeibullLoss (NLL of Bernoulli-Weibull distribution)
# LOSS = L1Loss()
#
LOSS = MSELoss()
LOSS
=
BernoulliGammaLoss
(
min_amount
=
1
)
LOSS
=
MSELoss
()
#
LOSS = BernoulliGammaLoss(min_amount=1)
# LOSS = BernoulliWeibullLoss(min_amount=1)
# batch size: number of time steps processed by the net in each iteration
BATCH_SIZE
=
16
# base learning rate: constant or CyclicLR policy
BASE_LR
=
1e-4
# maximum learning rate for CyclicLR policy
MAX_LR
=
1e-3
# stochastic optimization algorithm
OPTIM
=
torch
.
optim
.
SGD
# OPTIM = torch.optim.Adam
OPTIM_PARAMS
=
{
'
lr
'
:
1e-3
,
# learning rate
'
weight_decay
'
:
0
# regularization rate
}
# OPTIM = torch.optim.SGD
OPTIM
=
torch
.
optim
.
Adam
OPTIM_PARAMS
=
{
'
lr
'
:
BASE_LR
,
'
weight_decay
'
:
0
}
if
OPTIM
==
torch
.
optim
.
SGD
:
OPTIM_PARAMS
[
'
momentum
'
]
=
0.99
OPTIM_PARAMS
[
'
momentum
'
]
=
0.99
# SGD with momentum
# learning rate scheduler
# LR_SCHEDULER = torch.optim.lr_scheduler.MultiStepLR
# learning rate scheduler: CyclicLR policy
LR_SCHEDULER
=
None
LR_SCHEDULER_PARAMS
=
{
'
gamma
'
:
0.25
,
'
milestones
'
:
[
1
,
3
]}
# LR_SCHEDULER = torch.optim.lr_scheduler.CyclicLR
LR_SCHEDULER_PARAMS
=
{
'
base_lr
'
:
BASE_LR
,
'
max_lr
'
:
MAX_LR
,
'
mode
'
:
'
triangular
'
,
'
step_size_up
'
:
400
}
# whether to randomly shuffle time steps or to conserve time series for model
# training
...
...
@@ -142,9 +152,6 @@ SHUFFLE = True
# whether to normalize the training data to [0, 1]
NORM
=
True
# batch size: number of time steps processed by the net in each iteration
BATCH_SIZE
=
16
# network training configuration
TRAIN_CONFIG
=
{
'
checkpoint_state
'
:
{},
...
...
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