OFA-Sys/chinese-clip-vit-base-patch16
Original188.3Mparameters
Fixture1.6Mparameters
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.layer
Original · 12
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| TextLayer | 12 | 2 | ✓ kept |
vision_model.encoder.layers
Original · 12
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| VisionLayer | 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 | 45.2% | 66.9K | 4.2% |
| text_model.encoder.layer | 85.1M | 45.2% | 66.9K | 4.2% |
| text_model.embeddings | 16.6M | 8.8% | 1.4M | 87.4% |
| vision_model.embeddings | 741.9K | 0.4% | 61.8K | 3.9% |
| visual_projection | 393.2K | 0.2% | 2.0K | 0.1% |
| text_projection | 393.2K | 0.2% | 2.0K | 0.1% |
| vision_model.post_layernorm | 1.5K | 0.0% | 128 | 0.0% |
| 2 others | 1.5K | 0.0% | 129 | 0.0% |
Preserved properties
| Config | Property | Original | Fixture | |
|---|---|---|---|---|
| model | model_type | chinese_clip | chinese_clip | ✓ kept |
| text_config | model_type | chinese_clip_text_model | chinese_clip_text_model | ✓ kept |
| text_config | vocab_size | 21128 | 21128 | ✓ kept |
| text_config | hidden_act | gelu | gelu | ✓ kept |
| text_config | max_position_embeddings | 512 | 512 | ✓ kept |
| vision_config | model_type | chinese_clip_vision_model | chinese_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 | 16 | 16 | ✓ kept |
| vision_config | num_channels | 3 | 3 | ✓ kept |
Module classes
Instances of each class in the built model (prefix ChineseCLIP omitted).
| Class | Original | Fixture |
|---|---|---|
| Linear | 146 | 26 |
| LayerNorm | 51 | 11 |
| Dropout | 37 | 7 |
| TextAttention | 12 | 2 |
| TextIntermediate | 12 | 2 |
| TextLayer | 12 | 2 |
| TextOutput | 12 | 2 |
| TextSelfAttention | 12 | 2 |
| TextSelfOutput | 12 | 2 |
| VisionAttention | 12 | 2 |
| VisionLayer | 12 | 2 |
| VisionMLP | 12 | 2 |
| GELUActivation | 12 | 2 |
| QuickGELUActivation | 12 | 2 |
| Embedding | 4 | 4 |
| ModuleList | 2 | 2 |
| Model | 1 | 1 |
| TextEmbeddings | 1 | 1 |
| TextEncoder | 1 | 1 |
| TextModel | 1 | 1 |
| VisionEmbeddings | 1 | 1 |
| VisionEncoder | 1 | 1 |
| VisionModel | 1 | 1 |
| Conv2d | 1 | 1 |
Config changes
10 fields changed, 74 unchanged.
| Field | Original | Fixture |
|---|---|---|
| projection_dim | 512 | 32 |
| text_config.hidden_size | 768 | 64 |
| text_config.intermediate_size | 3072 | 128 |
| text_config.num_attention_heads | 12 | 4 |
| text_config.num_hidden_layers | 12 | 2 |
| 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 |