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

Iterate over predictands.

parent fcc5bc7f
No related branches found
No related tags found
No related merge requests found
...@@ -6,19 +6,33 @@ conda activate climax ...@@ -6,19 +6,33 @@ conda activate climax
# move to project repository # move to project repository
cd ~/git/climax cd ~/git/climax
# loss functions # predictands
LOSS=(L1Loss BernoulliGammaLoss BernoulliWeibullLoss MSELoss) PREDICTAND=(pr tasmin tasmax)
# iterate over loss functions # iterate over predictands
for loss in ${LOSS[@]}; do for predictand in ${PREDICTAND[@]}; do
# change loss function in configuration # change predictand in configuration
if [ "$loss" = "L1Loss" ] || [ "$loss" = "MSELoss" ]; then sed -i "s/PREDICTAND\s*=.*/PREDICTAND='$predictand'/" ./climax/main/config.py
sed -i "s/LOSS\s*=.*/LOSS=$loss()/" ./climax/main/config.py
# define available loss functions for current predictand
if [ "$predictand" = "pr" ]; then
LOSS=(L1Loss BernoulliGammaLoss BernoulliWeibullLoss MSELoss)
else else
sed -i "s/LOSS\s*=.*/LOSS=$loss(min_amount=1)/" ./climax/main/config.py LOSS=(L1Loss MSELoss)
fi fi
# run learning rate range test # iterate over loss functions
python climax/main/lr_range_test.py for loss in ${LOSS[@]}; do
# change loss function in configuration
if [ "$loss" = "L1Loss" ] || [ "$loss" = "MSELoss" ]; then
sed -i "s/LOSS\s*=.*/LOSS=$loss()/" ./climax/main/config.py
else
sed -i "s/LOSS\s*=.*/LOSS=$loss(min_amount=1)/" ./climax/main/config.py
fi
# run learning rate range test
python climax/main/lr_range_test.py
done
done done
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