All models

resmlp_36_224

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

Image classification · 620 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 (11 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
44.7M
Operations
620
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
m8812
Graph hash
7a2107a36e457fc52318b052078cfedb518931bb0a8844b4847543c2e75e0931
Skeleton hash
e5493934965c64f5d9b829b83a0d807bcd110fcb6db7b6922e895fe9e31587f2
Architecture hash
fcce96b646a0586b79d7c03e41f50594f188df0beeb6e5af8539280b5c471c29
Diagram SHA-256
cd262f38c2a27cf7b3f6e3e53e58b9dc18b8b60dda7d040efc4726ea16307ec1
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_36_224', pretrained=False)

What it is

This model is ResMLP-36; the paper's appendix compares ResMLP-S36 across numbers of training epochs.

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.