All models

ditn_real_sr_x4

A lightweight transformer that upscales an image four times while keeping reshape operations to a minimum.

Diffusion and generative · 213 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

Parameters
158.5K
Operations
213
Framework
PyTorch
Recurrent
No
Published
2023
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
m11800
Graph hash
909e9200aab6825bd181ea5e327e310ff2107f58071932e8698111890b912868
Skeleton hash
224579590fc53dd168a9d96dbc805f1f3dbdc8dd09ed04515e98fdc25e57bf6e
Architecture hash
d9fab7db6ebca0f31629a3dd17a6ee5c55b5b19f51ae73c29465cc6d7165ffd4
Diagram SHA-256
737a6738e14b5b64c5e8e4ca2bf4172c764bda1f440d49c3a5c830ec2bab2796
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

menagerie.classics.ri_ts_graph_sr:build_ditn: build({})

What it is

DITN, the Deployment-friendly Inner-patch Transformer Network, is a lightweight transformer for single image super-resolution. The task is to reconstruct a high-resolution image from its low-resolution observation. The paper argues that earlier efficient super-resolution transformers looked only at performance on the training platform, without optimizing for the platform the model is deployed on.

The building block is UFONE, short for UnFolding ONce is Enough. Feature maps are unfolded into patches only once, a run of Inner-patch Transformer Layers (ITL) works inside those patches, and only then are the features folded back. Attention inside patches misses long-range structure, so each unit also has a Spatial-Aware Layer (SAL) that uses dilated convolutions to cover a large receptive field. At the end, a convolution layer and a pixel-shuffle layer upscale the features to the output image.

For deployment on TensorRT, the paper fuses the three matrix multiplications that produce the attention queries, keys and values into one operator. Its DITN-Real variant starts from the smaller DITN-Tiny and swaps the normalization layer for the alternative the paper proposes. The paper describes that substitute as a tanh activation function and a 1×1 convolution, and reports that it slightly lowers accuracy compared with DITN-Tiny.

Key idea. The paper built a super-resolution transformer whose unit unfolds features into patches only once, which cuts the reshape operations that slow transformers down on deployment platforms.

  • DITN
  • Deployment-friendly Inner-patch Transformer Network
  • UFONE
  • Unfolding Once is Enough
  • DITN-Real
  • single image super-resolution
  • SISR
  • efficient transformer
  • lightweight super-resolution
  • TensorRT deployment

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