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