hustvl/vitmatte-small-composition-1k
Original25.8Mparameters
Fixture1.6Mparameters
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.
backbone.encoder.layer
Original · 12
Fixture · 3
| Kind | Original | Fixture | |
|---|---|---|---|
| no Conv2d | 8 | 2 | ✓ kept |
| Conv2d, VitDetLayerNorm, VitDetResBottleneckBlock | 4 | 1 | ✓ kept |
decoder.convstream.convs
Original · 3
Fixture · 3
| Kind | Original | Fixture | |
|---|---|---|---|
| ReLU | 3 | 3 | ✓ kept |
decoder.fusion_blocks
Original · 4
Fixture · 4
| Kind | Original | Fixture | |
|---|---|---|---|
| FusionBlock | 4 | 4 | ✓ 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 |
|---|---|---|---|---|
| backbone.encoder.layer | 23.3M | 90.2% | 167.3K | 10.6% |
| decoder.fusion_blocks | 1.9M | 7.2% | 1.1M | 70.8% |
| backbone.embeddings | 469.2K | 1.8% | 78.2K | 5.0% |
| decoder.convstream.convs | 209.8K | 0.8% | 209.8K | 13.3% |
| decoder.matting_head | 4.7K | 0.0% | 4.7K | 0.3% |
Preserved properties
| Config | Property | Original | Fixture | |
|---|---|---|---|---|
| model | model_type | vitmatte | vitmatte | ✓ kept |
| backbone_config | model_type | vitdet | vitdet | ✓ kept |
| backbone_config | hidden_act | gelu | gelu | ✓ kept |
| backbone_config | image_size | 512 | 512 | ✓ kept |
| backbone_config | patch_size | 16 | 16 | ✓ kept |
| backbone_config | num_channels | 4 | 4 | ✓ kept |
Module classes
Instances of each class in the built model (prefix VitMatte omitted).
| Class | Original | Fixture |
|---|---|---|
| Linear | 48 | 12 |
| LayerNorm | 24 | 6 |
| Conv2d | 22 | 13 |
| GELUActivation | 20 | 5 |
| Dropout | 12 | 3 |
| Identity | 12 | 3 |
| VitDetAttention | 12 | 3 |
| VitDetLayer | 12 | 3 |
| VitDetLayerNorm | 12 | 3 |
| VitDetMlp | 12 | 3 |
| BatchNorm2d | 8 | 8 |
| ReLU | 8 | 8 |
| BasicConv3x3 | 7 | 7 |
| VitDetResBottleneckBlock | 4 | 1 |
| FusionBlock | 4 | 4 |
| ModuleList | 3 | 3 |
| Sequential | 1 | 1 |
| VitDetBackbone | 1 | 1 |
| VitDetEmbeddings | 1 | 1 |
| VitDetEncoder | 1 | 1 |
| ConvStream | 1 | 1 |
| DetailCaptureModule | 1 | 1 |
| ForImageMatting | 1 | 1 |
| Head | 1 | 1 |
Config changes
6 fields changed, 39 unchanged.
| Field | Original | Fixture |
|---|---|---|
| backbone_config.hidden_size | 384 | 64 |
| backbone_config.num_attention_heads | 6 | 4 |
| backbone_config.num_hidden_layers | 12 | 3 |
| backbone_config.out_features | ["stage12"] | ["stage3"] |
| backbone_config.out_indices | [12] | [3] |
| hidden_size | 384 | 64 |