All models

MAML-net

Three few-shot image learners: the MAML conv base learner, a Matching Network and a Triplet network.

Image classification · 18 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 (26 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
32.9K
Operations
18
Framework
PyTorch
Recurrent
No
Published
ICML 2017
Cited by
8,510 (as of 17 October 2026)
Authors
Chelsea Finn, Pieter Abbeel, Sergey Levine
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
m1633
Graph hash
50d8df0b4ffe02567642a76c6e8ecf2241246659d97759225bb5616c145c3799
Skeleton hash
1fc41826a02d4dc6166c5d217ee220a9477781ecf6a4d4d389153684c24e19e7
Architecture hash
acf3c474022331fd64580f1330d3aeb5895d31d895cc06606638f9214382592f
Diagram SHA-256
77f1aeb650eefce7a53dcc9feabfd9c2504c8b5773a938304bd1703eda7ab089
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

MAML-net is the convolutional learner from Model-Agnostic Meta-Learning, which has 4 modules with a 3 × 3 convolutions and 64 filters, followed by batch normalization, a ReLU nonlinearity, and 2 × 2 max-pooling. This build follows the MiniImagenet setting, where the paper used 32 filters per layer to reduce overfitting.

About this model's family

Three few-shot learners share this family: the convolutional base learner from Model-Agnostic Meta-Learning (MAML), a Matching Network and a Triplet network, all small image networks meant to solve new learning tasks using only a small number of training samples. MAML's idea is to train the model's initial parameters such that the model has maximal performance on a new task after the parameters have been updated through one or more gradient steps. In effect, the method trains the model to be easy to fine-tune. The network traced here is MAML's classification learner, which has 4 modules with a 3 × 3 convolutions and 64 filters, followed by batch normalization, a ReLU nonlinearity, and 2 × 2 max-pooling. For MiniImagenet the paper used 32 filters per layer to reduce overfitting, and that is the width the captured member carries.

The Matching Network comes from Matching Networks for One Shot Learning, which learns a network that maps a small labelled support set and an unlabelled example to its label, obviating the need for fine-tuning to adapt to new class types. Its output for a new class is a linear combination of the labels in the support set. The weights come from an attention kernel, the simplest form being the softmax over the cosine distance between the embedded query and support examples. The paper's second insight is a training procedure built on a simple principle: test and train conditions must match. The embedding the captured member uses is the paper's simple yet powerful CNN: a stack of modules, each a 3 × 3 convolution with 64 filters followed by batch normalization, a Relu non-linearity and 2 × 2 max-pooling. The captured build leaves out the Full Contextual Embeddings, the LSTM additions that on Omniglot made no difference.

The Triplet network, from Deep metric learning using Triplet network, aims to learn useful representations by distance comparisons rather than as a side effect of classification. It is comprised of 3 instances of the same feedforward network with shared parameters, and when fed with 3 samples it outputs the two L2 distances between the embedded representation of two of its inputs from the representation of the third. A SoftMax over the two distances turns the task into a 2-class classification problem: which of x+ and x− is of the same class as x. On STL10 the TripletNet achieved the best known result for non-augmented data.

Key idea. MAML trains the model's parameters so that a small number of gradient steps with a small amount of training data from a new task will produce good generalization performance on that task. Matching Networks learn a network that maps a small labelled support set and an unlabelled example to its label, with no fine-tuning needed for new class types. The Triplet network learns useful representations by distance comparisons, using 3 instances of the same feedforward network with shared parameters.

  • meta-learning
  • few-shot learning
  • one-shot learning
  • MAML
  • Model-Agnostic Meta-Learning
  • MAML-net
  • Matching Networks
  • Matching Nets
  • MatchingNet
  • Triplet network
  • TripletNet
  • metric learning
  • Omniglot
  • miniImageNet
  • learn2learn
  • CNN4
  • Conv4

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

Cite the paper

@misc{he2015deepresiduallearningimage,
      title={Deep Residual Learning for Image Recognition}, 
      author={Kaiming He and Xiangyu Zhang and Shaoqing Ren and Jian Sun},
      year={2015},
      eprint={1512.03385},
      archivePrefix={arXiv},
      primaryClass={cs.CV},
      url={https://arxiv.org/abs/1512.03385}, 
}