SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2006.11325 · ICML · 2020

Self-Supervised Prototypical Transfer Learning for Few-Shot Classification

Carlos Medina, Arnout Devos, Matthias Grossglauser

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (1 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 1 has no contract verdict; 7 failures of our instrument; 1 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/2006.11325.json · badge: /api/ran/2006.11325.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
indy-lab/ProtoTransfer canonical (classifier label)
classifier basis: classifier_2025
4 ran · 1 no recorded run
ojss/samptransfer community
Papers with Code archive
4 ran · 0 no recorded run
FunctionStatusWhere it lives
Protonet Ran
ran on a synthesized input · constructed an object; no result was computed
indy-lab/ProtoTransfer/omni-mini/prototransfer/protonet.py
code served (permissive licence) · get_code("8b5dd421e59bc6a5")
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 an instance of its own class, Protonet: the run constructed the object and did not call it, so no result was computed. 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 torch.nn as nn

torch.manual_seed(0)

# Create a simple encoder module
class SimpleEncoder(nn.Module):
    def __init__(self, input_size=5, output_size=4):
        super(SimpleEncoder, self).__init__()
        self.fc = nn.Linear(input_size, output_size)
    
    def forward(self, x):
        return self.fc(x)

# Instantiate the encoder
encoder = SimpleEncoder(input_size=5, output_size=4)

# Define ARGS dict with all parameters for Protonet
ARGS = {
    'encoder': encoder,
    'distance': 'euclidean',
    'device': 'cpu'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Protonet — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Protonet 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
cosine_similarity Ran
ran; our contract draft was wrong, not the code
ojss/samptransfer/utils/proto_utils.py
pointer only (licence: NONE) · get_code("e0ea79d7ea081390")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ojss/samptransfer when it was checked. 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.

euclidean_distance Ran
ran; our contract draft was wrong, not the code
ojss/samptransfer/utils/proto_utils.py
pointer only (licence: NONE) · get_code("083427faad799a4d")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ojss/samptransfer when it was checked. 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.

euclidean_distance Ran
ran; our contract draft was wrong, not the code
indy-lab/ProtoTransfer/omni-mini/prototransfer/protonet.py
code served (permissive licence) · get_code("4cff643601aa1b0c")
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 Tensor, ndim 3, dtype family float, shape (2, 4, 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 torch

torch.manual_seed(0)

# The function computes euclidean distance between two sets of embeddings
# x and y both have shape (batch_size, num_examples, embedding_size)
# We need to create two tensors with this shape

batch_size = 2
num_examples_x = 4
num_examples_y = 3
embedding_size = 5

x = torch.randn(batch_size, num_examples_x, embedding_size)
y = torch.randn(batch_size, num_examples_y, embedding_size)

ARGS = {
    "x": x,
    "y": y,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 4, 3) — shape (2, 4, 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
get_prototypes Ran
ran; our contract draft was wrong, not the code
indy-lab/ProtoTransfer/omni-mini/prototransfer/protonet.py
code served (permissive licence) · get_code("8fb77482b9d9c2f1")
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 Tensor, ndim 3, dtype family float, shape (2, 3, 4) 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 torch

torch.manual_seed(0)

# Small embeddings tensor: (batch_size=2, num_examples=3, embedding_size=4)
embeddings = torch.randn(2, 3, 4, dtype=torch.float32)

# Targets tensor: (batch_size=2, num_examples=3) with class indices in range [0, num_classes-1]
targets = torch.tensor([[0, 1, 0], [1, 2, 1]], dtype=torch.long)

# Number of classes
num_classes = 3

ARGS = {
    "embeddings": embeddings,
    "targets": targets,
    "num_classes": num_classes,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 4) 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
prototypical_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
ojss/samptransfer/utils/proto_utils.py
pointer only (licence: NONE) · get_code("7afcf427b59e8a5c")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ojss/samptransfer when it was checked. 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.

prototypical_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
indy-lab/ProtoTransfer/omni-mini/prototransfer/protonet.py
code served (permissive licence) · get_code("df7db1db2fea7a21")
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 torch
import torch.nn.functional as F

torch.manual_seed(0)

# Parameters
batch_size = 2
num_classes = 3
num_examples = 4
embedding_size = 5

# Create prototypes: (batch_size, num_classes, embedding_size)
prototypes = torch.randn(batch_size, num_classes, embedding_size)

# Create embeddings: (batch_size, num_examples, embedding_size)
embeddings = torch.randn(batch_size, num_examples, embedding_size)

# Create targets: (batch_size, num_examples)
# Each target should be a class index in range [0, num_classes)
targets = torch.randint(0, num_classes, (batch_size, num_examples))

# Distance metric
distance = 'euclidean'

ARGS = {
    'prototypes': prototypes,
    'embeddings': embeddings,
    'targets': targets,
    'distance': distance
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — 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
sns Ran
ran; our contract draft was wrong, not the code
ojss/samptransfer/utils/proto_utils.py
pointer only (licence: NONE) · get_code("07799eb1ce6595d0")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, ojss/samptransfer when it was checked. 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.

get_num_samples Not yet run
unverified (harvested, no recorded run)
indy-lab/ProtoTransfer/omni-mini/prototransfer/protonet.py
code served (permissive licence) · get_code("1c8b5648679d11f1")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 8 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.

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

Most approaches in few-shot learning rely on costly annotated data related to the goal task domain during (pre-)training. Recently, unsupervised meta-learning methods have exchanged the annotation requirement for a reduction in few-shot classification performance. Simultaneously, in settings with realistic domain shift, common transfer learning has been shown to outperform supervised meta-learning. Building on these insights and on advances in self-supervised learning, we propose a transfer learning approach which constructs a metric embedding that clusters unlabeled prototypical samples and their augmentations closely together. This pretrained embedding is a starting point for few-shot classification by summarizing class clusters and fine-tuning. We demonstrate that our self-supervised prototypical transfer learning approach ProtoTransfer outperforms state-of-the-art unsupervised meta-learning methods on few-shot tasks from the mini-ImageNet dataset. In fewshot experiments with domain shift, our approach even has comparable performance to supervised methods, but requires orders of magnitude fewer labels. Nevertheless, most few-shot classification methods still require much annotated data for pre-training. Recently, several unsupervised meta-learning approaches, constructing episodes via pseudo-labeling

For agents

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

get_harvested_code_for_paper("2006.11325")
get_code_for_paper("2006.11325")
have("2006.11325")

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

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

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

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

Connect an agent — have() is free.