forked from pcyin/NL2code
-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathtest.sh
More file actions
31 lines (27 loc) · 1.06 KB
/
test.sh
File metadata and controls
31 lines (27 loc) · 1.06 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
export MKL_THREADING_LAYER=GNU
output="runs/full_canon"
# rm ${output}/parser.log
device="cpu"
dataset="django.pnet.fullcanon.dataset.freq3.par_info.refact.space_only.bin"
# django dataset
echo "testing django dataset"
commandline="-batch_size 10 -max_epoch 50 -valid_per_batch 4000 -save_per_batch 4000 -decode_max_time_step 100 -optimizer adam -rule_embed_dim 128 -node_embed_dim 64 -valid_metric bleu"
# -model ./runs/fixed/model.iter16000.npz"
datatype="django"
# decode testing set, and evaluate the model which achieves the best bleu and accuracy, resp.
for model in "model.best_bleu.npz" "model.best_acc.npz"; do
THEANO_FLAGS="mode=FAST_RUN,device=${device},floatX=float32,exception_verbosity=high" python code_gen.py \
-data_type ${datatype} \
-data data/${dataset} \
-output_dir ${output} \
-model ${output}/${model} \
${commandline} \
decode \
-saveto ${output}/${model}.decode_results.test.bin
python code_gen.py \
-data_type ${datatype} \
-data data/${dataset} \
-output_dir ${output} \
evaluate \
-input ${output}/${model}.decode_results.test.bin
done