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

fix logit-to-multi-hot conversion in example #26936

Merged

Conversation

ranchlai
Copy link
Contributor

What does this PR do?

This PR fixes #26830 . The bug might lead to difference in measuring multi-label acc (Slightly higher precision and lower recall).

@younesbelkada Would you please review.

@ranchlai ranchlai changed the title fix logit to multi-hot converstion fix logit-to-multi-hot conversion in example Oct 19, 2023
Copy link
Contributor

@younesbelkada younesbelkada left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Thanks!

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint.

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Should we not apply sigmoid ?
Otherwise fine with me. There is a way to pass a specific function to the trainer: preprocess_logits_for_metrics which can apply the sigmoid otherwise (but not needed here)

@ranchlai
Copy link
Contributor Author

@ArthurZucker I've updated the comment for educational purpose.

Copy link
Collaborator

@ArthurZucker ArthurZucker left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Cool thanks!

@younesbelkada younesbelkada merged commit f71c9cc into huggingface:main Oct 23, 2023
8 checks passed
staghado pushed a commit to staghado/transformers that referenced this pull request Oct 24, 2023
* fix logit to multi-hot converstion

* add comments

* typo
EduardoPach pushed a commit to EduardoPach/transformers that referenced this pull request Nov 19, 2023
* fix logit to multi-hot converstion

* add comments

* typo
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

Successfully merging this pull request may close these issues.

Possible error in text classification example code for multi-label classification
4 participants