microsoft/swinv2-tiny-patch4-window16-256
Original28.3Mparameters
Fixture5.4Mparameters
Layer stacks1compared
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.
swinv2.encoder.layers
Original · 4
Fixture · 4
| Kind | Original | Fixture | |
|---|---|---|---|
| PatchMerging | 3 | 3 | ✓ kept |
| no PatchMerging | 1 | 1 | ✓ 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 |
|---|---|---|---|---|
| swinv2.encoder.layers | 27.6M | 97.3% | 4.9M | 90.5% |
| classifier | 769.0K | 2.7% | 513.0K | 9.5% |
| swinv2.embeddings | 4.9K | 0.0% | 3.3K | 0.1% |
| swinv2.layernorm | 1.5K | 0.0% | 1.0K | 0.0% |
Preserved properties
| Config | Property | Original | Fixture | |
|---|---|---|---|---|
| model | model_type | swinv2 | swinv2 | ✓ kept |
| model | hidden_act | gelu | gelu | ✓ kept |
| model | image_size | 256 | 256 | ✓ kept |
| model | patch_size | 4 | 4 | ✓ kept |
| model | num_channels | 3 | 3 | ✓ kept |
Module classes
Instances of each class in the built model (prefix Swinv2 omitted).
| Class | Original | Fixture |
|---|---|---|
| Linear | 100 | 36 |
| Dropout | 37 | 13 |
| LayerNorm | 29 | 13 |
| GELUActivation | 12 | 4 |
| ReLU | 12 | 4 |
| Sequential | 12 | 4 |
| Attention | 12 | 4 |
| Intermediate | 12 | 4 |
| Layer | 12 | 4 |
| Output | 12 | 4 |
| SelfAttention | 12 | 4 |
| SelfOutput | 12 | 4 |
| DropPath | 11 | 3 |
| ModuleList | 5 | 5 |
| Stage | 4 | 4 |
| PatchMerging | 3 | 3 |
| AdaptiveAvgPool1d | 1 | 1 |
| Conv2d | 1 | 1 |
| Identity | 1 | 1 |
| Embeddings | 1 | 1 |
| Encoder | 1 | 1 |
| ForImageClassification | 1 | 1 |
| Model | 1 | 1 |
| PatchEmbeddings | 1 | 1 |
Config changes
5 fields changed, 28 unchanged.
| Field | Original | Fixture |
|---|---|---|
| depths | [2, 2, 6, 2] | [1, 1, 1, 1] |
| embed_dim | 96 | 64 |
| hidden_size | 768 | 64 |
| num_heads | [3, 6, 12, 24] | [2, 4, 8, 16] |
| num_layers | 4 | 2 |