Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

a bug for MNLI eval result? #32

Open
xwuShirley opened this issue Jan 23, 2022 · 1 comment
Open

a bug for MNLI eval result? #32

xwuShirley opened this issue Jan 23, 2022 · 1 comment

Comments

@xwuShirley
Copy link

xwuShirley commented Jan 23, 2022

Hi there @madlag,

Thanks for your great work!
It seems there is a problem for MNLI
if we update text_classification/parameters.json with do_train: 0
and run following,

mkdir result
export CUDA_VISIBLE_DEVICES=0; python command_line.py finetune --json-path  text_classification/parameters.json mnli result

we get the result
"eval_results_mnli.json"

{
    "eval_accuracy": 0.06622516556291391,
    "eval_loss": 15.527382850646973
}

I would really appreciate if you could double-check the code and there could be a bug? Or I must miss something.

@xiaoxiawu-microsoft
Copy link

xiaoxiawu-microsoft commented Jan 23, 2022

@madlag it looks like the prediction mapping is wrong? [0,1,2], ==>-1[2,0,1]: if you go to https://github.com/huggingface/nn_pruning/blob/main/examples/text_classification/glue_xp.py#L332 and and update the prediction

            old_preds = preds.copy()
            preds = [] #[0,1,2] ==>-1[2,0,1] 
            for x in old_preds:
                if x ==2:
                    preds.append(1)
                if x ==1:
                    preds.append(0)
                if x==0:
                    preds.append(2)

we get the result
"eval_results_mnli.json"
{
"eval_accuracy": 0.8469689251146205,
"eval_loss": 15.527382850646973
}

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants