All models

CNAPS

A few-shot image classifier whose parameters are set per task by an adaptation network, with no gradient steps.

Image classification · 989 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 (422 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
25.4M
Operations
989
Framework
PyTorch
Recurrent
No
Published
NeurIPS 2019
Cited by
135 (as of 27 October 2026)
Authors
James Requeima, Jonathan Gordon, John Bronskill and others
License
MIT
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
m15139
Graph hash
bba10aeb62973796e99c68530d03de01ed64a683456cd781c66dd77751176de2
Skeleton hash
797503708337f757441a0d125950f1f6f98f2ce74fb175392002a8d589e74be8
Architecture hash
1964e4261d01b0396faef642eb077b3c5abc0876ddddfff8e060ab2594cace71
Diagram SHA-256
eac50cbfe34d476544effb4cd9e42395bc8f48399041be0555fddf3c0a919266
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

What it is

CNAPs (Conditional Neural Adaptive Processes) is an image classification system that, after an initial multi-task training phase, adapts automatically to new tasks encountered at test time. It comprises a classifier whose parameters are modulated by an adaptation network that takes the current task's dataset as input. The paper's timing experiments find it computationally efficient at test time because it does not involve gradient based adaptation.

The classifier is a feature extractor whose output is fed into a linear classifier. The implementation uses a ResNet18 with FiLM layers after every convolutional layer, and the paper states that the task-specific FiLM parameters are fewer than 0.7% of the parameters in the model. The adaptation network has an auto-regressive parameterization, which the paper says avoids under-fitting while proving easy to train in practice, and the classifier weights come from a permutation invariant architecture.

The paper reports the best results at the time on the Meta-Dataset benchmark. The code release also covers a FiLM + TaskNorm configuration from the TaskNorm paper, while this model uses auto-regressive FiLM adaptation. The README notes that its listed results differ from those published in the paper because they fix a shuffle buffer bug in Meta-Dataset.

Key idea. CNAPs adapts an image classifier to a new task without gradient steps, using an adaptation network that takes the task's dataset as input and modulates the classifier's parameters.

  • cnaps
  • cnap
  • conditional neural adaptive processes
  • few-shot classification
  • few-shot learning
  • meta-learning
  • multi-task classification
  • meta-dataset

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

Cite the paper

@misc{requeima2020fastflexiblemultitaskclassification,
      title={Fast and Flexible Multi-Task Classification Using Conditional Neural Adaptive Processes}, 
      author={James Requeima and Jonathan Gordon and John Bronskill and Sebastian Nowozin and Richard E. Turner},
      year={2020},
      eprint={1906.07697},
      archivePrefix={arXiv},
      primaryClass={stat.ML},
      url={https://arxiv.org/abs/1906.07697}, 
}