openai/clip-vit-base-patch32
Original151.3Mparameters
Fixture3.5Mparameters
Layer stacks2compared
Findings0to review
✓ Same architecture, smaller
Every module class, layer kind and checked property of the original is in the fixture.
Layer stacks
One square per layer, colored by kind: the layer's module classes and type attributes. Hover a square for its index and kind.
text_model.encoder.layers
Original · 12
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| EncoderLayer | 12 | 2 | ✓ kept |
vision_model.encoder.layers
Original · 12
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| EncoderLayer | 12 | 2 | ✓ kept |
Where the parameters are
Share of each model's parameters per component. Vocabulary and patch sizes are kept, so embeddings usually take a larger share of the fixture.
Original
Fixture
| Component | Original | Share | Fixture | Share |
|---|---|---|---|---|
| vision_model.encoder.layers | 85.1M | 56.2% | 66.9K | 1.9% |
| text_model.encoder.layers | 37.8M | 25.0% | 66.9K | 1.9% |
| text_model.embeddings | 25.3M | 16.7% | 3.2M | 90.4% |
| vision_model.embeddings | 2.4M | 1.6% | 199.9K | 5.7% |
| visual_projection | 393.2K | 0.3% | 2.0K | 0.1% |
| text_projection | 262.1K | 0.2% | 2.0K | 0.1% |
| vision_model.pre_layrnorm | 1.5K | 0.0% | 128 | 0.0% |
| 3 others | 2.6K | 0.0% | 257 | 0.0% |
Preserved properties
| Config | Property | Original | Fixture | |
|---|---|---|---|---|
| model | model_type | clip | clip | ✓ kept |
| text_config | model_type | clip_text_model | clip_text_model | ✓ kept |
| text_config | vocab_size | 49408 | 49408 | ✓ kept |
| text_config | tie_word_embeddings | True | True | ✓ kept |
| text_config | hidden_act | quick_gelu | quick_gelu | ✓ kept |
| text_config | max_position_embeddings | 77 | 77 | ✓ kept |
| vision_config | model_type | clip_vision_model | clip_vision_model | ✓ kept |
| vision_config | tie_word_embeddings | True | True | ✓ kept |
| vision_config | hidden_act | quick_gelu | quick_gelu | ✓ kept |
| vision_config | image_size | 224 | 224 | ✓ kept |
| vision_config | patch_size | 32 | 32 | ✓ kept |
| vision_config | num_channels | 3 | 3 | ✓ kept |
Module classes
Instances of each class in the built model (prefix CLIP omitted).
| Class | Original | Fixture |
|---|---|---|
| Linear | 146 | 26 |
| LayerNorm | 51 | 11 |
| Attention | 24 | 4 |
| EncoderLayer | 24 | 4 |
| MLP | 24 | 4 |
| QuickGELUActivation | 24 | 4 |
| Embedding | 3 | 3 |
| Encoder | 2 | 2 |
| ModuleList | 2 | 2 |
| Model | 1 | 1 |
| TextEmbeddings | 1 | 1 |
| TextModel | 1 | 1 |
| VisionEmbeddings | 1 | 1 |
| VisionModel | 1 | 1 |
| Conv2d | 1 | 1 |
Config changes
11 fields changed, 80 unchanged.
| Field | Original | Fixture |
|---|---|---|
| projection_dim | 512 | 32 |
| text_config.hidden_size | 512 | 64 |
| text_config.intermediate_size | 2048 | 128 |
| text_config.num_attention_heads | 8 | 4 |
| text_config.num_hidden_layers | 12 | 2 |
| text_config.projection_dim | 512 | 32 |
| vision_config.hidden_size | 768 | 64 |
| vision_config.intermediate_size | 3072 | 128 |
| vision_config.num_attention_heads | 12 | 4 |
| vision_config.num_hidden_layers | 12 | 2 |
| vision_config.projection_dim | 512 | 32 |