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 consistency, testing for forward_head w/ pre_logits, reset_classifier, models with pre_logits size != unpooled feature size #2195

Merged
merged 2 commits into from
Jun 7, 2024

Conversation

rwightman
Copy link
Collaborator

  • add test that model supports forward_head(x, pre_logits=True)
  • add head_hidden_size attr to all models and set differently from num_features attr when head has hidden layers
  • test forward_features() feat dim == model.num_features and pre_logits feat dim == self.head_hidden_size
  • more consistency in reset_classifier signature, add typing
  • asserts in some heads where pooling cannot be disabled
    Fix [BUG] TypeError: forward_head() got an unexpected keyword argument 'pre_logits' #2194

@HuggingFaceDocBuilderDev

The docs for this PR live here. All of your documentation changes will be reflected on that endpoint. The docs are available until 30 days after the last update.

rwightman added 2 commits June 7, 2024 13:53
…fier, models with pre_logits size != unpooled feature size

* add test that model supports forward_head(x, pre_logits=True)
* add head_hidden_size attr to all models and set differently from num_features attr when head has hidden layers
* test forward_features() feat dim == model.num_features and pre_logits feat dim == self.head_hidden_size
* more consistency in reset_classifier signature, add typing
* asserts in some heads where pooling cannot be disabled
Fix #2194
@rwightman rwightman force-pushed the refactor_pre_logits branch from bbb13de to 5ee0676 Compare June 7, 2024 20:53
@rwightman rwightman merged commit 5517b05 into main Jun 7, 2024
24 checks passed
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.

[BUG] TypeError: forward_head() got an unexpected keyword argument 'pre_logits'
2 participants