timm documentation

MambaOut

You are viewing main version, which requires installation from source. If you'd like regular pip install, checkout the latest stable version (v1.0.30).
Hugging Face's logo
Join the Hugging Face community

and get access to the augmented documentation experience

to get started

MambaOut

Category: CNN · Code: timm/models/mambaout.py · Architectures: 11 · Pretrained weights: 12 (11 with ImageNet-1k results)

MambaOut stacks Gated CNN blocks, Mamba blocks without the state space model (SSM) token mixer, to test whether SSMs are needed for image classification.

Papers

Usage

See the Quickstart for loading pretrained weights, image preprocessing and fine-tuning, and Feature Extraction for using the models as backbones.

>>> import timm
>>> model = timm.create_model('mambaout_tiny.in1k', pretrained=True)
>>> data_config = timm.data.resolve_model_data_config(model)

Model API support

FeatureMambaOut
features_only=True feature maps✓ (strides 4, 8, 16, 32)
forward_intermediates()✓
prune_intermediate_layers()✓
Any input size, no changes needed✓
set_input_size()–
dynamic_img_size=True–
set_grad_checkpointing()✓
Layer-wise LR decay (group_matcher())✓
reset_classifier()✓

✓ supported, ✓ (square) works for square sizes only, ✗ not supported, – not needed (the model already accepts any input size). Checked by running each feature on a randomly initialized model (MambaOut with mambaout_femto at 224), other architectures of the same class are expected to behave the same. See the Model API page for details.

Architectures

ArchitectureParams (M)GMACsInput sizePretrained weights
mambaout_base84.8115.832241
mambaout_base_plus_rw101.6619.192243
mambaout_base_short_rw88.8316.312241
mambaout_base_tall_rw86.4816.152241
mambaout_base_wide_rw94.4517.782241
mambaout_femto7.301.162241
mambaout_kobe9.141.522241
mambaout_small48.498.962241
mambaout_small_rw48.508.962241
mambaout_tiny26.554.492241
test_mambaout0.450.031600

GMACs and parameter counts are for the default input size and classifier of each architecture, from the benchmark results.

Pretrained weights

Top-1 is ImageNet-1k validation accuracy from results-imagenet.csv at the listed eval size, - if the weight has no ImageNet-1k result (e.g. pretraining or image-text weights). Classes is the size of the pretrained classifier, none for weights without one.

WeightInput sizeTop-1 (%)Eval sizeClassesLicenseHub
mambaout_base.in1k224 (test 288)84.7302881000apache-2.0timm
mambaout_base_plus_rw.sw_e150_in12k224 (test 288)--11821apache-2.0timm
mambaout_base_plus_rw.sw_e150_in12k_ft_in1k224 (test 288)86.9162881000apache-2.0timm
mambaout_base_plus_rw.sw_e150_r384_in12k_ft_in1k38487.5083841000apache-2.0timm
mambaout_base_short_rw.sw_e500_in1k224 (test 288)84.8422881000apache-2.0timm
mambaout_base_tall_rw.sw_e500_in1k224 (test 288)84.9882881000apache-2.0timm
mambaout_base_wide_rw.sw_e500_in1k224 (test 288)84.9662881000apache-2.0timm
mambaout_femto.in1k224 (test 288)79.9122881000apache-2.0timm
mambaout_kobe.in1k224 (test 288)81.0642881000apache-2.0timm
mambaout_small.in1k224 (test 288)84.5122881000apache-2.0timm
mambaout_small_rw.sw_e450_in1k224 (test 288)84.6042881000apache-2.0timm
mambaout_tiny.in1k224 (test 288)83.4522881000apache-2.0timm
Update on GitHub