Skip to content

Navigation Menu

Sign in
Appearance settings

Search code, repositories, users, issues, pull requests...

Provide feedback

We read every piece of feedback, and take your input very seriously.

Saved searches

Use saved searches to filter your results more quickly

Sign up
Appearance settings

Update ML Decoder #2045

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

Draft
fffffgggg54 wants to merge 109 commits into huggingface:main
base: main
Choose a base branch
Loading
from fffffgggg54:ml-decoder
Draft

Update ML Decoder #2045

fffffgggg54 wants to merge 109 commits into huggingface:main from fffffgggg54:ml-decoder

Conversation

Copy link
Contributor

@fffffgggg54 fffffgggg54 commented Nov 27, 2023
edited
Loading

Update ML Decoder's TransformerDecoderLayerOptimal module to comply with what nn.TransformerDecoder expects. Current changes work with resnet50.

add_ml_decoder_head needs to be updated for other models. In my limited testing, the following case works with RegNet:

elif hasattr(model, 'head'): # ClassifierHead and ConvNext
 if hasattr(model.head, 'flatten'): # ConvNext case
 model.head.flatten = nn.Identity()
 model.head.global_pool = nn.Identity()
 del model.head.fc
 num_classes = model.num_classes
 num_features = model.num_features
 model.head.fc = MLDecoder(num_classes=num_classes, initial_num_features=num_features)

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Reviewers
No reviews
Assignees
No one assigned
Labels
None yet
Projects
None yet
Milestone
No milestone
Development

Successfully merging this pull request may close these issues.

AltStyle によって変換されたページ (->オリジナル) /