Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion downstream/Clone-detection-CodeNet/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ python ./code/run.py \
--epoch 2 \
--block_size 400 \
--train_batch_size 8 \
--eval_batch_size 16 \
--eval_batch_size 64 \
--learning_rate 2e-5 \
--max_grad_norm 1.0 \
--evaluate_during_training \
Expand Down
2 changes: 1 addition & 1 deletion downstream/Clone-detection-CodeNet/run_aug_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -20,7 +20,7 @@ python ./code/run.py \
--test_predictions_file=aug_predictions.jsonl \
--epoch 2 \
--block_size 400 \
--eval_batch_size 16 \
--eval_batch_size 64 \
--learning_rate 2e-5 \
--max_grad_norm 1.0 \
--seed 123456 2>&1| tee $output_dir/aug_train.log
Expand Down
2 changes: 1 addition & 1 deletion downstream/Clone-detection-POJ104/run.sh
Original file line number Diff line number Diff line change
Expand Up @@ -17,7 +17,7 @@ python ./code/run.py \
--epoch 2 \
--block_size 400 \
--train_batch_size 8 \
--eval_batch_size 16 \
--eval_batch_size 64 \
--learning_rate 2e-5 \
--max_grad_norm 1.0 \
--evaluate_during_training \
Expand Down
2 changes: 1 addition & 1 deletion downstream/Clone-detection-POJ104/run_aug_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ python ./code/run.py \
--test_predictions_file=aug_predictions.jsonl \
--epoch 2 \
--block_size 400 \
--eval_batch_size 16 \
--eval_batch_size 64 \
--learning_rate 2e-5 \
--max_grad_norm 1.0 \
--seed 123456 2>&1| tee $output_dir/aug_train.log
Expand Down
2 changes: 1 addition & 1 deletion downstream/Code-classification-CodeNet/run_aug_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ python ./code/run.py \
--num_train_epochs 5 \
--block_size 256 \
--train_batch_size 8 \
--eval_batch_size 16 \
--eval_batch_size 64 \
--learning_rate 2e-5 \
--max_grad_norm 1.0 \
--seed 123456 2>&1 | tee $output_dir/aug_test.log
2 changes: 1 addition & 1 deletion downstream/Code-classification-POJ104/run_aug_test.sh
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,7 @@ python ./code/run.py \
--num_train_epochs 5 \
--block_size 256 \
--train_batch_size 8 \
--eval_batch_size 16 \
--eval_batch_size 64 \
--learning_rate 2e-5 \
--max_grad_norm 1.0 \
--seed 123456 2>&1 | tee $output_dir/aug_test.log
24 changes: 0 additions & 24 deletions experiments/grouped/codebert-base.yaml

This file was deleted.

22 changes: 22 additions & 0 deletions experiments/grouped/codebert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# InvPT pre-training: Grouped — CodeBERT
# Effective batch size: 16 * 16 = 256
# Usage: python modeling/cli.py run experiments/grouped/codebert.yaml

dataset_path: "data/aug_csn.jsonl"
model_name: "microsoft/codebert-base"

batch_size: 16
num_epochs: 3
gradient_accumulation_steps: 16
learning_rate: 2.0e-5

seed: 0
run_name: "InvCodeBERT-grouped"

alpha: 1.0
temperature: 0.1
max_seq_length: 512
sample_rate: 0.2

contra_mode: "grouped"
max_num_augs: 6
23 changes: 23 additions & 0 deletions experiments/grouped/contrabert_c.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# InvPT pre-training: Grouped — ContraBERT_C
# Effective batch size: 16 * 16 = 256
# Usage: python modeling/cli.py run experiments/grouped/contrabert_c.yaml

dataset_path: "data/aug_csn.jsonl"
model_name: "./saved_models/ContraBERT_C"
tokenizer_name: "microsoft/codebert-base"

batch_size: 16
num_epochs: 3
gradient_accumulation_steps: 16
learning_rate: 2.0e-5

seed: 0
run_name: "InvContraBERT_C-grouped"

alpha: 1.0
temperature: 0.1
max_seq_length: 512
sample_rate: 0.2

contra_mode: "grouped"
max_num_augs: 6
23 changes: 23 additions & 0 deletions experiments/grouped/contrabert_g.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,23 @@
# InvPT pre-training: Grouped — ContraBERT_G
# Effective batch size: 16 * 16 = 256
# Usage: python modeling/cli.py run experiments/grouped/contrabert_g.yaml

dataset_path: "data/aug_csn.jsonl"
model_name: "./saved_models/ContraBERT_G"
tokenizer_name: "microsoft/graphcodebert-base"

batch_size: 16
num_epochs: 3
gradient_accumulation_steps: 16
learning_rate: 2.0e-5

seed: 0
run_name: "InvContraBERT_G-grouped"

alpha: 1.0
temperature: 0.1
max_seq_length: 512
sample_rate: 0.2

contra_mode: "grouped"
max_num_augs: 6
22 changes: 22 additions & 0 deletions experiments/grouped/graphcodebert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# InvPT pre-training: Grouped — GraphCodeBERT
# Effective batch size: 16 * 16 = 256
# Usage: python modeling/cli.py run experiments/grouped/graphcodebert.yaml

dataset_path: "data/aug_csn.jsonl"
model_name: "microsoft/graphcodebert-base"

batch_size: 16
num_epochs: 3
gradient_accumulation_steps: 16
learning_rate: 2.0e-5

seed: 0
run_name: "InvGraphCodeBERT-grouped"

alpha: 1.0
temperature: 0.1
max_seq_length: 512
sample_rate: 0.2

contra_mode: "grouped"
max_num_augs: 6
21 changes: 21 additions & 0 deletions experiments/supcon/codebert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# InvPT pre-training: SupCon — CodeBERT
# Effective batch size: 64 * 4 = 256
# Usage: python modeling/cli.py run experiments/supcon/codebert.yaml

dataset_path: "data/aug_csn.jsonl"
model_name: "microsoft/codebert-base"

batch_size: 64
num_epochs: 3
gradient_accumulation_steps: 4
learning_rate: 2.0e-5

seed: 0
run_name: "InvCodeBERT-supcon"

alpha: 1.0
temperature: 0.1
max_seq_length: 512
sample_rate: 0.2

contra_mode: "supcon"
22 changes: 22 additions & 0 deletions experiments/supcon/contrabert_c.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,22 @@
# InvPT pre-training: SupCon — ContraBERT_C
# Effective batch size: 64 * 4 = 256
# Usage: python modeling/cli.py run experiments/supcon/contrabert_c.yaml

dataset_path: "data/aug_csn.jsonl"
model_name: "./saved_models/ContraBERT_C"
tokenizer_name: "microsoft/codebert-base"

batch_size: 64
num_epochs: 3
gradient_accumulation_steps: 4
learning_rate: 2.0e-5

seed: 0
run_name: "InvContraBERT_C-supcon"

alpha: 1.0
temperature: 0.1
max_seq_length: 512
sample_rate: 0.2

contra_mode: "supcon"
Original file line number Diff line number Diff line change
@@ -1,5 +1,6 @@
# InvPT pre-training experiment configuration
# Usage: python -m modeling.pretrain --config experiments/base.yaml
# InvPT pre-training: SupCon — ContraBERT_G
# Effective batch size: 64 * 4 = 256
# Usage: python modeling/cli.py run experiments/supcon/contrabert_g.yaml

dataset_path: "data/aug_csn.jsonl"
model_name: "./saved_models/ContraBERT_G"
Expand All @@ -11,12 +12,11 @@ gradient_accumulation_steps: 4
learning_rate: 2.0e-5

seed: 0
run_name: "InvContraBERT_G-aug02-supcon"
run_name: "InvContraBERT_G-supcon"

alpha: 1.0
temperature: 0.1
max_seq_length: 512
sample_rate: 0.2

contra_mode: "supcon"
# max_num_augs: 6 # only used with contra_mode: "grouped"
21 changes: 21 additions & 0 deletions experiments/supcon/graphcodebert.yaml
Original file line number Diff line number Diff line change
@@ -0,0 +1,21 @@
# InvPT pre-training: SupCon — GraphCodeBERT
# Effective batch size: 64 * 4 = 256
# Usage: python modeling/cli.py run experiments/supcon/graphcodebert.yaml

dataset_path: "data/aug_csn.jsonl"
model_name: "microsoft/graphcodebert-base"

batch_size: 64
num_epochs: 3
gradient_accumulation_steps: 4
learning_rate: 2.0e-5

seed: 0
run_name: "InvGraphCodeBERT-supcon"

alpha: 1.0
temperature: 0.1
max_seq_length: 512
sample_rate: 0.2

contra_mode: "supcon"