All models

resmlp_12_224

An image classifier built only from linear layers and MLPs applied to image patches, with residual connections.

Image classification · 212 operations Checked

100%

Showing the top corner; full diagram not loaded yetShowing a small copy; full diagram not loaded yetLarge diagram, not loaded yet

Open SVG

Loading diagram (30 KB)

Open in a new tab

Click or tap a spot to read it up close. Scroll or drag inside the diagram to move through it. Zoom with + and − or Ctrl and scroll. Press 0 for the whole graph. Swipe inside the diagram to move through it. Use + and − to zoom.

At a glance

Family
resmlp
Parameters
15.4M
Operations
212
Framework
PyTorch
Recurrent
No
License
Apache-2.0
Checked
Passed: the trace was replayed operation by operation and matched the model's own output for this input.

Files

The diagram is a drawing of a TorchLens trace of the source code. It contains no code or weights.

Details
Stable ID
m8810
Graph hash
a72a6c759600ead87605a97494e050604a94871c83eaf4883e4d833a00c04aa1
Skeleton hash
100e30799a9f0815def2b74fa6ac1804ee9a7d9273265c0b7974cb5c923de129
Architecture hash
29193b5e52a4f48813cfe950ea219b6cf8dbc7ca9c4d611f00051f334be80e35
Diagram SHA-256
f63659e8d479a24bde28e5c5058a2ac305b7aa8ebe9f44e7b5c8f0957dea13c8
TorchLens version
2.35.3
Renderer
graphviz 2.43.0+pyvips 3.2.0+libvips 8.18.7+render-opts@06c1f0d3
Check
Forward pass replayed in PyTorch

How this diagram was made

timm.create_model('resmlp_12_224', pretrained=False)

What it is

This model is ResMLP-12; the paper lists its 12-layer default configuration with a working dimension of 384.

About this model's family

ResMLP is an image classification network built entirely from multi-layer perceptrons (MLPs). It takes image patches, projects them with a linear layer, and then repeatedly applies two residual steps: a linear layer through which patches exchange information, applied to all channels independently, and a small MLP that mixes channels within each patch. At the end, the patch representations are average pooled and fed to a linear classifier.

The paper presents the design as a simplified Vision Transformer (ViT): the self-attention sublayer is replaced by a linear layer, leaving only linear layers and the GELU non-linearity. There is no positional embedding and no class token, and in place of normalization based on batch statistics it uses a learnable affine operator that only rescales and shifts its input element-wise.

On ImageNet, the paper reports that ResMLP's trade-off between accuracy, FLOPs and throughput is not as good as that of convolutional networks or Transformers, and argues that its accuracy still suggests the layer design's structural constraints do not have a drastic influence on performance. It also finds that ResMLP greatly benefits from distillation from a convnet, as DeiT models do.

Key idea. The paper shows that a residual network built only from linear layers and GELU, given a modern training strategy, attains good accuracy/complexity trade-offs on ImageNet.

  • ResMLP
  • residual MLP
  • all-MLP image classifier
  • feedforward network
  • image classification
  • ImageNet
  • timm
  • residual multi-layer perceptrons

AI-written summary, based on the paper and checked automatically against it; not reviewed by a person. Corrections welcome.