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

Script for bootstrapped model training in batch mode.

parent b2dacc24
No related branches found
No related tags found
No related merge requests found
#!/usr/bin/env bash
# activate conda environment
conda activate climax
# move to project repository
cd ~/git/climax
# predictands
PREDICTAND=(pr tasmin tasmax)
# set number of ensemble members
sed -i "s/BOOTSTRAP\s*=.*/BOOTSTRAP\=10/" ./climax/main/config.py
# iterate over predictands
for predictand in ${PREDICTAND[@]}; do
# 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 MSELoss)
else
LOSS=(L1Loss MSELoss)
fi
# 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 downscaling
python climax/main/downscale_bootstrap.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