-
Notifications
You must be signed in to change notification settings - Fork 0
Expand file tree
/
Copy pathstrat_1_dataset_pretraining.sh
More file actions
58 lines (45 loc) · 2.09 KB
/
Copy pathstrat_1_dataset_pretraining.sh
File metadata and controls
58 lines (45 loc) · 2.09 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
51
52
53
54
55
56
57
58
: '
Strategy #1: Execution Aware Pre-Training + Fine-Tuning
Model is pre-trained providing a submission code and its input trying to predict execution aware information.
Execution data is tailored to a specific test-case/input, so each instance is (code,input)-wise. The same code can appear multiple times with different input and execution data to learn.
The subsequent fine-tuning is performed using slow-fast pairs trying to teach the model how to generate faster code.
In this case each dataset is built considering all the test cases for each program (ref), so each instance is program-wise, i.e. each code appears one single.
'
mkdir -p logs
mkdir -p datasets/strategy_1/finetuning
mkdir -p datasets/strategy_1/pretraining
mkdir -p datasets/strategy_1/traces
RAW_TRACES_PATH=./tracing/pretraining/tree
SEQ_FOLDER=./tracing/pretraining/sequences
PT_OUT_FOLDER=./datasets/strategy_1/pretraining
SUFFIX="pretraining"
python src/data/generate_exec_labels.py \
--sequence-folder $SEQ_FOLDER \
--trace-path $RAW_TRACES_PATH \
--output-path $PT_OUT_FOLDER \
--suffix $SUFFIX
# Generate specialized datasets
# Line Execution (LE)
python src/data/specialize.py \
--dataset-path "${PT_OUT_FOLDER}/execaware_full_pretraining.jsonl" \
--output-path "${PT_OUT_FOLDER}/strategy_1_LE.csv" \
--source-col vanilla_format \
--target-col code_exec_lbl
# Line Coverage (LC)
python src/data/specialize.py \
--dataset-path "${PT_OUT_FOLDER}/execaware_full_pretraining.jsonl" \
--output-path "${PT_OUT_FOLDER}/strategy_1_LC.csv" \
--source-col vanilla_format \
--target-col line_cov_lbl
# Branch Coverage (BC)
python src/data/specialize.py \
--dataset-path "${PT_OUT_FOLDER}/execaware_full_pretraining.jsonl" \
--output-path "${PT_OUT_FOLDER}/strategy_1_BC.csv" \
--source-col vanilla_format \
--target-col branch_covered_in_trace
# Program States (PS)
python src/data/specialize.py \
--dataset-path "${PT_OUT_FOLDER}/execaware_full_pretraining.jsonl" \
--output-path "${PT_OUT_FOLDER}/strategy_1_PS.csv" \
--source-col vanilla_format \
--target-col prog_states_lbl