diff --git a/Scripts/lr_range_test.sh b/Scripts/lr_range_test.sh index 1dc3c25383ccd36d5095c7310c98ab501b5716ba..780d680bc3a773ce2e51e302264bfe5f702d77d7 100644 --- a/Scripts/lr_range_test.sh +++ b/Scripts/lr_range_test.sh @@ -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