SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1606.04080 · 2016

Matching Networks for One Shot Learning

Charles Blundell, Oriol Vinyals, Koray Kavukcuoglu, Timothy Lillicrap, Daan Wierstra

arXiv · PDF · Open in the Atlas

Code that ran

11 of 16 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 6 failures of our instrument; 5 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/1606.04080.json · badge: /api/ran/1606.04080.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
facebookresearch/low-shot-shrink-hallucinate extension (classifier label)
classifier basis: classifier_2025
3 ran · 3 no recorded run
fujenchu/matchingNet community (classifier label)
classifier basis not recorded on the link
3 ran · 1 no recorded run
AntreasAntoniou/MatchingNetworks community (classifier label)
classifier basis not recorded on the link
3 ran · 0 no recorded run
schatty/matching-networks-tf reimplementation (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
KamalM8/Few-Shot-learning-Fashion reimplementation (classifier label)
classifier basis: classifier_2025
0 ran · 1 no recorded run
FunctionStatusWhere it lives
augment_image Ran
ran on a synthesized input
AntreasAntoniou/MatchingNetworks/data.py
code served (permissive licence) · get_code("022f6566a93cb4b6")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 3, dtype family float, shape (4, 6, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a small test image with shape (height, width, channels)
# Using distinct dimensions: height=4, width=6, channels=3
image = np.random.rand(4, 6, 3).astype(np.float32)

# k is the rotation angle in degrees
k = 45

# channels is the number of color channels
channels = 3

ARGS = {
    'image': image,
    'k': k,
    'channels': channels
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, skimage — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family float, shape (4, 6, 3) — shape (4, 6, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
build_experiment_folder Ran
ran on a synthesized input
AntreasAntoniou/MatchingNetworks/utils/storage.py
code served (permissive licence) · get_code("c2ad5f5a2003fec1")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import shutil

# Create a temporary directory for the experiment
temp_dir = tempfile.mkdtemp()
experiment_name = os.path.join(temp_dir, 'test_experiment')

ARGS = {
    'experiment_name': experiment_name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
encode_lowshot_trainset Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
facebookresearch/low-shot-shrink-hallucinate/matching_network.py
pointer only (licence: NOASSERTION) · get_code("f48ebd2b61e5d2ee")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/low-shot-shrink-hallucinate (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

load_statistics Ran
ran on a synthesized input
AntreasAntoniou/MatchingNetworks/utils/storage.py
code served (permissive licence) · get_code("348fc98221adb8ed")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tempfile
import os

# Create a temporary directory and a log file
temp_dir = tempfile.mkdtemp()
log_file_path = os.path.join(temp_dir, 'experiment_log')

# Create a sample log file with CSV data
with open(log_file_path, 'w') as f:
    f.write('epoch,loss,accuracy\n')
    f.write('1,0.5,0.85\n')
    f.write('2,0.3,0.90\n')
    f.write('3,0.2,0.92\n')

ARGS = {
    'log_path': temp_dir,
    'log_name': 'experiment_log'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
mean_confidence_interval Ran
ran; our contract draft was wrong, not the code
fujenchu/matchingNet/utils.py
code served (permissive licence) · get_code("fbec209cee9a4df8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np
import scipy as sp
import scipy.stats

# Create sample data for the mean_confidence_interval function
data = [1.2, 1.5, 1.3, 1.4, 1.6, 1.5, 1.4, 1.3]

# Define ARGS dict with all parameters
ARGS = {
    "data": data,
    "confidence": 0.95
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
perelement_accuracy Ran
ran; our contract draft was wrong, not the code
facebookresearch/low-shot-shrink-hallucinate/matching_network.py
pointer only (licence: NOASSERTION) · get_code("e8592464cb90d8a9")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/low-shot-shrink-hallucinate (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

perelement_accuracy Ran
ran; our contract draft was wrong, not the code
facebookresearch/low-shot-shrink-hallucinate/low_shot.py
pointer only (licence: NOASSERTION) · get_code("bf3de7601f74fa35")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/low-shot-shrink-hallucinate (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded.

preprocess_config Ran
ran; our contract draft was wrong, not the code
schatty/matching-networks-tf/scripts/train/run_train.py
code served (permissive licence) · get_code("5d3cb59c1da5b053")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Create a config dictionary with various parameters
# The function expects a dict-like object with string keys
c = {
    'data.train_way': '5',
    'data.test_way': '10',
    'data.train_support': '3',
    'data.test_support': '5',
    'data.train_query': '15',
    'data.test_query': '20',
    'data.query': '10',
    'data.support': '5',
    'data.way': '5',
    'data.episodes': '100',
    'data.gpu': '0',
    'data.cuda': '1',
    'model.lstm_size': '128',
    'train.epochs': '50',
    'train.patience': '10',
    'data.batch': '32',
    'train.restore': '0',
    'train.lr': '0.001',
    'model.name': 'protonet',
    'data.dataset': 'omniglot',
    'train.optimizer': 'adam',
    'some.other.param': 'value'
}

ARGS = {'c': c}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
preprocess_config Ran
ran; our contract draft was wrong, not the code
schatty/matching-networks-tf/scripts/eval/run_eval.py
code served (permissive licence) · get_code("53241b134fbef5ed")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# The function expects a dictionary-like object 'c' that it can iterate over
# and access values using c[param]
# It processes parameters by converting some to int, some to float, and leaving others as-is

c = {
    'data.train_way': '5',
    'data.test_way': '5',
    'data.train_support': '1',
    'data.test_support': '1',
    'data.train_query': '15',
    'data.test_query': '15',
    'data.query': '10',
    'data.support': '5',
    'data.way': '3',
    'data.episodes': '100',
    'data.gpu': '0',
    'data.cuda': '0',
    'data.batch': '32',
    'model.lstm_size': '128',
    'train.epochs': '50',
    'train.patience': '10',
    'train.lr': '0.001',
    'model.name': 'lstm_model',
    'data.dataset': 'omniglot',
    'train.optimizer': 'adam',
}

ARGS = {'c': c}
Setup block drafted by
a language model, Claude Sonnet 4.5, prompt python_fixture_v1
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
randomCrop Ran
ran on a synthesized input
fujenchu/matchingNet/dataloader.py
code served (permissive licence) · get_code("40e189283ad47450")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 3, dtype family float, shape (80, 80, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create a valid image array with shape (84, 84, 3) to allow for random cropping
# The function extracts either an 80x80 crop starting from random offsets (0-3)
# or a fixed 80x80 crop from center (2:82, 2:82)
img = np.random.randint(0, 256, size=(84, 84, 3), dtype=np.uint8)

ARGS = {
    "img": img,
    "centralCrop": False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 3, dtype family float, shape (80, 80, 3) — shape (80, 80, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
read_miniImageNet_pathonly Ran
ran on a synthesized input
fujenchu/matchingNet/utils.py
code served (permissive licence) · get_code("9a4547e2e8c3de87")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned list, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import os
import tempfile
import shutil

# Create a temporary directory structure that mimics miniImageNet
temp_dir = tempfile.mkdtemp()
miniImageNetPath = temp_dir + '/'

# Create trainval directory structure
trainval_dir = os.path.join(temp_dir, 'trainval')
os.makedirs(trainval_dir)

# Create test directory structure
test_dir = os.path.join(temp_dir, 'test')
os.makedirs(test_dir)

# Create a few class directories with dummy image files
for class_idx in range(3):
    trainval_class_dir = os.path.join(trainval_dir, f'class_{class_idx}')
    os.makedirs(trainval_class_dir)
    for img_idx in range(5):
        img_path = os.path.join(trainval_class_dir, f'image_{img_idx}.jpg')
        open(img_path, 'w').close()
    
    test_class_dir = os.path.join(test_dir, f'class_{class_idx}')
    os.makedirs(test_class_dir)
    for img_idx in range(5):
        img_path = os.path.join(test_class_dir, f'image_{img_idx}.jpg')
        open(img_path, 'w').close()

ARGS = {
    'TESTMODE': False,
    'miniImageNetPath': miniImageNetPath,
    'imgPerCls': 600
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list, ndim 2, dtype family float — a list output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
get_combination_miniImageNet_5way1shot_random_pathonly_episode_variableWays Not yet run
unverified (harvested, no recorded run)
fujenchu/matchingNet/utils.py
code served (permissive licence) · get_code("65ca7af4547afb9c")
How it ran

no invocation recorded.

get_test_loader Not yet run
unverified (harvested, no recorded run)
facebookresearch/low-shot-shrink-hallucinate/low_shot.py
pointer only (licence: NOASSERTION) · get_code("e18676657d36d810")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/low-shot-shrink-hallucinate (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

lr_schedule Not yet run
unverified (harvested, no recorded run)
KamalM8/Few-Shot-learning-Fashion/experiments/proto_nets.py
code served (permissive licence) · get_code("c7b885cfa7d6a165")
How it ran

no invocation recorded.

train_matching_network Not yet run
unverified (harvested, no recorded run)
facebookresearch/low-shot-shrink-hallucinate/matching_network.py
pointer only (licence: NOASSERTION) · get_code("e6d5e6bdc3bf15c4")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/low-shot-shrink-hallucinate (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

training_loop Not yet run
unverified (harvested, no recorded run)
facebookresearch/low-shot-shrink-hallucinate/low_shot.py
pointer only (licence: NOASSERTION) · get_code("3bfa0f8b278ac054")
How it ran

The body of this sample is withheld: GitHub could not classify the licence of this paper's repository, facebookresearch/low-shot-shrink-hallucinate (NOASSERTION). The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded.

Also present in other papers' code

Of 16 samples lifted from this paper's linked repositories, 16 carry a function identity and 0 do not. Of the 16 distinct functions with an identity, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 later) and 13 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

FunctionAlso present inEarliest-datedOthers named
mean_confidence_interval 1 other paper
1 later
1711.06025 (2017-11)
Learning to Compare: Relation Network for Few-Shot Learning
preprocess_config 1 other paper
1 later
1902.03477 (2019-02)
The Omniglot challenge: a 3-year progress report
preprocess_config 1 other paper
1 later
1902.03477 (2019-02)
The Omniglot challenge: a 3-year progress report

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

Learning from a few examples remains a key challenge in machine learning. Despite recent advances in important domains such as vision and language, the standard supervised deep learning paradigm does not offer a satisfactory solution for learning new concepts rapidly from little data. In this work, we employ ideas from metric learning based on deep neural features and from recent advances that augment neural networks with external memories. Our framework 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. We then define one-shot learning problems on vision (using Omniglot, ImageNet) and language tasks. Our algorithm improves one-shot accuracy on ImageNet from 87.6% to 93.2% and from 88.0% to 93.8% on Omniglot compared to competing approaches. We also demonstrate the usefulness of the same model on language modeling by introducing a one-shot task on the Penn Treebank.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("1606.04080")
get_code_for_paper("1606.04080")
have("1606.04080")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/1606.04080.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/1606.04080.svg)](https://syntology.ai/paper/1606.04080)

Connect an agent — have() is free.