This repository has been archived by the owner on Aug 15, 2023. It is now read-only.
-
Notifications
You must be signed in to change notification settings - Fork 4
/
Copy pathrun.sh
85 lines (80 loc) · 1.42 KB
/
run.sh
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
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
#!/usr/bin/env bash
set -e
DATASET=dataset
MODEL=resnet18
LR=3e-3
IMSIZE=224
AUG=medium
N_EPOCHS=30
BS=256
N_WORKERS=10
FAST=False
DEBUG=False
# bash argparse
while (( "$#" )); do
case "$1" in
--dataset)
DATASET=$2
shift 2
;;
--model)
MODEL=$2
shift 2
;;
--n-epochs)
N_EPOCHS=$2
shift 2
;;
--image-size)
IMSIZE=$2
shift 2
;;
--aug)
AUG=$2
shift 2
;;
--lr)
LR=$2
shift 2
;;
--batch-size)
BS=$2
shift 2
;;
--n-workers)
N_WORKERS=$2
shift 2
;;
--fast)
FAST=True
shift 1
;;
--debug)
DEBUG=True
shift 1
;;
*) # preserve positional arguments
shift
;;
esac
done
for fold in 0 1 2 3 4; do
notes="${MODEL}.multistep.lr_${LR}.n_epochs_${N_EPOCHS}.aug_${AUG}"
if [ "${FAST}" == "True" ]; then
notes="${notes}.fast"
fi
python run_nn.py train-fold \
--in-csv=./data/${DATASET}/dataset.csv \
--in-dir=./data/${DATASET} \
--model=${MODEL} \
--fold=${fold} \
--n_epochs=${N_EPOCHS} \
--image-size=${IMSIZE} \
--augmentation=${AUG} \
--learning-rate=${LR} \
--batch-size=${BS} \
--n-workers=${N_WORKERS} \
--fast=${FAST} \
--logdir=./logs/${DATASET}/${notes}/fold_${fold} \
--verbose=${DEBUG}
done