-
Notifications
You must be signed in to change notification settings - Fork 3
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Lingkai Kong
committed
Nov 16, 2020
1 parent
d6a1905
commit 01bfb09
Showing
5 changed files
with
1,398 additions
and
1 deletion.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,2 +1,35 @@ | ||
# Calibrated-BERT-Fine-Tuning | ||
Code for Paper: Calibrated Pre-trained Language Model Fine-Tuning via Manifold Smoothing | ||
This repo contains our code for paper: | ||
|
||
Calibrated Language Model Fine-Tuning for In- and Out-of-Distribution Data, EMNLP2020. | ||
|
||
[[paper](https://arxiv.org/abs/2010.11506)] | ||
|
||
![SDE-Net](figure/illustration.png) | ||
|
||
## Training & Evaluation | ||
|
||
Training with BERT base: | ||
``` | ||
CUDA_VISIBLE_DEVICES=0 python bert.py --dataset 20news-15 --seed 0 | ||
``` | ||
Evaluation with BERT base | ||
``` | ||
python test.py --model base --in_dataset 20news-15 --out_dataset 20news-5 --index 0 | ||
``` | ||
Evaluation with temperature scaling | ||
``` | ||
python test.py --model temperature --in_dataset 20news-15 --out_dataset 20news-5 --index 0 | ||
``` | ||
Evaluation with monte-carlo dropout | ||
``` | ||
python test.py --model mc-dropout --in_dataset 20news-15 --out_dataset 20news-5 --eva_iter 10 --index 0 | ||
``` | ||
Training with manifold smoothing | ||
``` | ||
CUDA_VISIBLE_DEVICES=0,1 python manifold-smoothing.py --dataset 20news-15 --seed 0 --eps_in 0.0001 --eps_out 0.001 --eps_y 0.1 | ||
``` | ||
Evaluation with manifold smoothing | ||
``` | ||
python test.py --model manifold-smoothing --in_dataset 20news-15 --out_dataset 20news-5 --eps_in 0.0001 --eps_out 0.001 --eps_y 0.1 | ||
``` |
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Oops, something went wrong.