- Download datasets from here
- Setup environment with
conda env create -f environment.yml
- Train a baseline MTL system with
python train.py --do-train --eval-every 2000 --run-name baseline
- Evaluate the system on test set with
python train.py --do-eval --sub-file mtl_submission.csv --save-dir save/baseline-01
- Upload the csv file in
save/baseline-01
to the test leaderboard. For the validation leaderboard, runpython train.py --do-eval --sub-file mtl_submission_val.csv --save-dir save/baseline-01 --eval-dir datasets/oodomain_val
maml.py
: MAML implementation for DistillBERT- class
MAML()
with the following methods different fromtrain.py
:outer_evaluate
: evaluation method for meta-step (outer-loop)task
: define task (support/query)get_task_dataset
: get support and query datasets and make embeddingsinner_loop_train
: MAML inner-loop gradient descent updateinner_loop_query
: define query set for each task and calculate the gradient of loss with query setinner_loop
: the overall inner_loop step
- class
- Train a MAML:
python maml.py --do-train --eval-every 2000 --run-name maml
- additional arguments in
args.py
:oodomain
: whether to use OOD set for trainingoodomain_train-dir
: oodomain_train set pathindomain_eval
: whether to use the overall indomain_val during meta-step model evaluation and updateouter_num_epochs
: # of epochs for the outer-loop trainingouter_lr
: outer-loop learning raten_task
: # of tasks used for inner-loop trainingp_oodomain_task
: proportion of task pool from OOD setk_shot
: # of sample in the support and query set