[GH-ISSUE #51] Multimodal projection matrix with ModifiedResNet #46

Closed
opened 2026-10-31 21:10:12 +00:00 by bsakaguchi · 2 comments
Owner

Originally created by @PaulLerner on GitHub (Mar 3, 2021).
Original GitHub issue: https://github.com/openai/CLIP/issues/51

Hi,

There's something unclear to me about the code:
It's seems quite clear that the image is projected in the multimodal space here with the VisualTransformer and that the text is projected there but what about ModifiedResNet? It doesn't seem to project the visual features in the multimodal space, did I miss something?

Bests,

Originally created by @PaulLerner on GitHub (Mar 3, 2021). Original GitHub issue: https://github.com/openai/CLIP/issues/51 Hi, There's something unclear to me about the code: It's seems quite clear that the image is projected in the multimodal space [here](https://github.com/openai/CLIP/blob/main/clip/model.py#L233) with the VisualTransformer and that the text is projected [there](https://github.com/openai/CLIP/blob/main/clip/model.py#L349) but what about ModifiedResNet? It doesn't seem to project the visual features in the multimodal space, did I miss something? Bests,
Author
Owner

@jongwook commented on GitHub (Mar 4, 2021):

It's not explicitly written as the other operations, but the projection matrix corresponding to the ResNet models is here, within the self-attention pooling operation. This reduces the dimensionality from the resnet width to the embedding dimension.

<!-- gh-comment-id:790440364 --> @jongwook commented on GitHub (Mar 4, 2021): It's not explicitly written as the other operations, but the projection matrix corresponding to the ResNet models is [here](https://github.com/openai/CLIP/blob/main/clip/model.py#L82-L83), within the self-attention pooling operation. This reduces the dimensionality from the resnet width to the embedding dimension.
Author
Owner

@PaulLerner commented on GitHub (Mar 4, 2021):

Oh ok, I thought there would be an extra layer after this, as in VisualTransformer, thanks !

<!-- gh-comment-id:790446720 --> @PaulLerner commented on GitHub (Mar 4, 2021): Oh ok, I thought there would be an extra layer after this, as in VisualTransformer, thanks !
Sign in to join this conversation.
No labels
pull-request
No milestone
No project
No assignees
1 participant
Notifications
Due date
The due date is invalid or out of range. Please use the format "yyyy-mm-dd".

No due date set.

Dependencies

No dependencies set.

Reference
openai/CLIP#46
No description provided.