forked from UnitTestBot/UTBotJava
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtrain_iteratively.sh
More file actions
50 lines (36 loc) · 1.2 KB
/
train_iteratively.sh
File metadata and controls
50 lines (36 loc) · 1.2 KB
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
#!/bin/bash
TIME_LIMIT=${1}
ITERATIONS=${2}
OUTPUT_DIR=${3}
PYTHON_COMMAND=${4}
declare -a models=("linear" "nn16" "nn32" "nn64" "nn128")
WORKDIR="."
echo "Start training data on heuristical based selectors"
$WORKDIR/scripts/train_data.sh $TIME_LIMIT
echo "Start iterative learning of models"
for (( i=0; i < $ITERATIONS; i++ ))
do
echo "Start $i iteration"
for model in "${models[@]}"
do
EXTRA_ARGS=""
if [[ $model == *"nn"* ]]; then
EXTRA_ARGS="--hidden_dim $(echo $model | cut -c 3-)"
echo "EXTRA_ARGS=$EXTRA_ARGS"
fi
COMMAND="$PYTHON_COMMAND $WORKDIR/scripts/train.py --features_dir $WORKDIR/eval/features --output_dir $OUTPUT_DIR/$model/$i --prog_list $WORKDIR/scripts/prog_list --model $model $EXTRA_ARGS"
echo "TRAINING COMMAND=$COMMAND"
$COMMAND
done
while read prog; do
prog="${prog%%[[:cntrl:]]}"
for model in "${models[@]}"
do
PREDICTOR="BASE"
if [[ $model == *"linear"* ]]; then
PREDICTOR="LINEAR"
fi
$WORKDIR/scripts/run_contest_estimator.sh $prog $TIME_LIMIT "NN_REWARD_GUIDED_SELECTOR $OUTPUT_DIR/$model/$i $PREDICTOR" "true eval/features/jlearch/$model$i/$prog"
done
done <"$WORKDIR/scripts/prog_list"
done