-
Notifications
You must be signed in to change notification settings - Fork 3
/
template.job
62 lines (48 loc) · 1.6 KB
/
template.job
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
#!/bin/bash
#SBATCH -t 6:00:00
#SBATCH -N 1
#SBATCH -n 16
#SBATCH -p normal
# START PARAMS
METHOD
DATASET
BLACKBOX
PLAUS
OPTC
OPTK
FOLD
# END PARAMS
# copy folder for experiments
mkdir "$TMPDIR"/robust_cfe
# copy all except the result folder
echo "about to copy main folder"
for f in "$HOME"/robust_cfe/*; do
if [ "$f" != "$HOME"/robust_cfe/"results" ]; then
cp -r "$f" "$TMPDIR"/robust_cfe/
fi
done
# copy, from the result folder, the blackboxes
echo "about to copy black boxes"
mkdir "$TMPDIR"/robust_cfe/results
cp -r "$HOME"/robust_cfe/results/blackboxes "$TMPDIR"/robust_cfe/results/
# access the folder
echo "accessing main folder"
cd "$TMPDIR"/robust_cfe
# activate virtual environment
echo "activating virtual environment"
source robenv/bin/activate
# run experiment
echo "running experiment"
if [ $METHOD = "lore" ]; then
python3 run.py --method "$METHOD" --dataset "$DATASET" --blackbox "$BLACKBOX" --check_plausibility "$PLAUS" --optimize_C_robust "$OPTC" --optimize_K_robust "$OPTK" --n_jobs 16 --n_reps 3 --n_samples_fold 5 --run_only_fold "$FOLD"
else
python3 run.py --method "$METHOD" --dataset "$DATASET" --blackbox "$BLACKBOX" --check_plausibility "$PLAUS" --optimize_C_robust "$OPTC" --optimize_K_robust "$OPTK" --n_jobs 16 --n_reps 5 --run_only_fold "$FOLD"
fi
# collect results (no longer need to copy blackboxes)
for f in "$TMPDIR"/robust_cfe/results/*; do
if [ "$f" != "$TMPDIR"/robust_cfe/results/blackboxes ]; then
cp -r "$f" "$HOME"/robust_cfe/results/
fi
done
# below alternative version that copies blackboxes back
#cp -r "$TMPDIR"/robust_cfe/results/* "$HOME"/robust_cfe/results/