All models

coatnext_nano_rw_224

timm's coatnext_nano_rw_224, a CoAtNet-style hybrid that stacks convolution stages under attention stages.

Image classification · 479 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 (24 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

Parameters
14.7M
Operations
479
Framework
PyTorch
Recurrent
No
Published
arXiv 2021
Cited by
733 (as of 9 October 2026)
Authors
Zihang Dai, Hanxiao Liu, Quoc Viet Le, Mingxing Tan
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
m3825
Graph hash
058e276f280818c158ee07ddfba1d67be4fcbbd21f8d521ea488decb7b7bff37
Skeleton hash
2ca142c8686e09450818a6135c5b99601b6bd108c8003d411821155b1b3cf542
Architecture hash
f0ed18851ee4ca8d7ddec917ada2a91925789c5c89aca60f8115f761e5fb5e44
Diagram SHA-256
bc2547e3deab94b192fdd572056f184c7056aad4087dd82dfb372c23038eebdc
TorchLens version
2.36.0
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('coatnext_nano_rw_224', pretrained=False)

What it is

CoAtNet, pronounced "coat" net, is a family of hybrid image models that combine depthwise convolution and self-attention in one network. The starting observation is that Transformers tend to have larger model capacity, but their generalization can be worse than convolutional networks due to the lack of the right inductive bias.

The first insight is that depthwise convolution and self-attention can be naturally unified via simple relative attention. The second is that vertically stacking convolution layers and attention layers in a principled way is surprisingly effective in improving generalization, capacity and efficiency.

Without extra data, CoAtNet reaches 86.0% ImageNet top-1 accuracy. Pre-trained on 13M ImageNet-21K images it reaches 88.56%, matching a ViT-huge pre-trained with 300M JFT-300M images while using 23x less data. Scaled up further with JFT-3B, it hits 90.88% top-1 on ImageNet, which the paper reports as a new state-of-the-art result.

Key idea. Unifying depthwise convolution and self-attention through relative attention and stacking convolution and attention stages vertically in one hybrid backbone.

  • CoAtNet
  • coatnext
  • coatnext_nano_rw_224
  • convolution and attention
  • hybrid backbone
  • relative attention
  • image classification
  • ImageNet
  • timm maxxvit

AI-written summary, checked automatically against its sources; not reviewed by a person. Corrections welcome.

Cite the paper

@misc{dai2021coatnetmarryingconvolutionattention,
      title={CoAtNet: Marrying Convolution and Attention for All Data Sizes}, 
      author={Zihang Dai and Hanxiao Liu and Quoc V. Le and Mingxing Tan},
      year={2021},
      eprint={2106.04803},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/2106.04803}, 
}