forked from UCSD-PL/proverbot9001
-
Notifications
You must be signed in to change notification settings - Fork 0
/
reinforce.sh
executable file
·68 lines (58 loc) · 1.74 KB
/
reinforce.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
#!/usr/bin/env bash
set -ex
# determine physical directory of this script
src="${BASH_SOURCE[0]}"
while [ -L "$src" ]; do
dir="$(cd -P "$(dirname "$src")" && pwd)"
src="$(readlink "$src")"
[[ $src != /* ]] && src="$dir/$src"
done
MYDIR="$(cd -P "$(dirname "$src")" && pwd)"
[ "$#" -ge 4 ] || (echo "4 argument required, $# provided" ; exit 1)
cd $MYDIR
GPU=$1
MODEL=$2
PROOFS=$3
EPISODES=$4
TAG=$5
shift 5
while (( "$#" )); do
case "$1" in
*) # preserve all other arguments
PARAMS="$PARAMS $1"
shift
;;
esac
done
if test ! -f "data/$MODEL-q-$PROOFS-$EPISODES-$TAG.dat" || test -f "data/$MODEL-q-$PROOFS-$EPISODES-$TAG.tmp"; then
cat data/compcert-test-files.txt|xargs python3 src/reinforce.py \
--predictor-weights=data/polyarg-weights.dat \
--start-from=data/"$MODEL"-q-pretrain.dat \
--prelude=./CompCert \
--estimator="$MODEL" \
--demonstrate-from=search-report-minimal \
--proofs-file=cc-proofs-$PROOFS.txt \
--progress \
--train-every-min=8 \
--train-every-max=16 \
--batch-size=512 \
-j4 \
--num-episodes=$EPISODES \
--gpu=$GPU \
data/compcert-scrape.txt \
data/$MODEL-q-$PROOFS-$EPISODES-$TAG.dat $PARAMS || true
else
echo "Resuming from existing reinforced weights"
fi
python3 src/mk_reinforced_weights.py \
data/polyarg-weights.dat \
data/$MODEL-q-$PROOFS-$EPISODES-$TAG.dat \
data/re-$MODEL-$PROOFS-$EPISODES-$TAG.dat
cat data/compcert-test-files.txt|xargs ./src/search_file.py \
--weightsfile=data/re-$MODEL-$PROOFS-$EPISODES-$TAG.dat \
--prelude=./CompCert \
--progress \
-o search-report-re-$MODEL-$PROOFS-$EPISODES-$TAG \
-j8 \
--proofs-file=cc-proofs-$PROOFS.txt \
--gpu=$GPU