CIDAS/clipseg-rd64-refined
Original150.7Mparameters
Fixture4.3Mparameters
Layer stacks3compared
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.
clip.text_model.encoder.layers
Original · 12
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| EncoderLayer | 12 | 2 | ✓ kept |
clip.vision_model.encoder.layers
Original · 12
Fixture · 2
| Kind | Original | Fixture | |
|---|---|---|---|
| EncoderLayer | 12 | 2 | ✓ kept |
decoder.layers
Original · 3
Fixture · 3
| Kind | Original | Fixture | |
|---|---|---|---|
| DecoderLayer | 3 | 3 | ✓ 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 |
|---|---|---|---|---|
| clip.vision_model.encoder.layers | 85.1M | 56.4% | 66.9K | 1.6% |
| clip.text_model.encoder.layers | 37.8M | 25.1% | 66.9K | 1.6% |
| clip.text_model | 25.3M | 16.8% | 3.2M | 73.7% |
| decoder.layers | 843.5K | 0.6% | 843.5K | 19.6% |
| clip.vision_model | 745.0K | 0.5% | 62.1K | 1.4% |
| clip.visual_projection | 393.2K | 0.3% | 2.0K | 0.0% |
| clip.text_projection | 262.1K | 0.2% | 2.0K | 0.0% |
| 5 others | 283.6K | 0.2% | 86.9K | 2.0% |
Preserved properties
| Config | Property | Original | Fixture | |
|---|---|---|---|---|
| model | model_type | clipseg | clipseg | ✓ kept |
| text_config | model_type | clipseg_text_model | clipseg_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 | clipseg_vision_model | clipseg_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 CLIPSeg omitted).
| Class | Original | Fixture |
|---|---|---|
| Linear | 169 | 49 |
| LayerNorm | 57 | 17 |
| Attention | 27 | 7 |
| MLP | 27 | 7 |
| EncoderLayer | 24 | 4 |
| QuickGELUActivation | 24 | 4 |
| ReLU | 5 | 5 |
| ModuleList | 4 | 4 |
| DecoderLayer | 3 | 3 |
| Embedding | 3 | 3 |
| Encoder | 2 | 2 |
| Conv2d | 2 | 2 |
| ConvTranspose2d | 2 | 2 |
| Decoder | 1 | 1 |
| ForImageSegmentation | 1 | 1 |
| Model | 1 | 1 |
| TextEmbeddings | 1 | 1 |
| TextModel | 1 | 1 |
| VisionEmbeddings | 1 | 1 |
| VisionModel | 1 | 1 |
| Sequential | 1 | 1 |
Config changes
10 fields changed, 89 unchanged.
| Field | Original | Fixture |
|---|---|---|
| extract_layers | [3, 6, 9] | [0, 1, 1] |
| 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 |
| 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 |