All models

resmlp_24_224

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

Image classification · 416 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 (14 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
30M
Operations
416
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
m8811
Graph hash
e6a097e10e4920033965189ce0dcf5eccadd66e4697e8ba1504b2acfd7785473
Skeleton hash
7ea1d9ec2d6ae7f5ecfd1529171ed5d0a1bfe5b090775be5bf7e4a1dee9711c6
Architecture hash
eeab1605589138deab7b036edb04a856b00ec0ddc728a2387619d1359da589aa
Diagram SHA-256
a1979bb40d41af1357e26dbec4dd1b0e2a08623908ad981062019788f25764b2
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_24_224', pretrained=False)

What it is

This model is ResMLP-24; the paper lists its 24-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.