SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2103.13841 · ICCV · 2021

Universal Representation Learning from Multiple Domains for Few-shot Classification

Hakan Bilen, Xialei Liu, Wei-Hong Li

arXiv · PDF · Open in the Atlas

Code that ran

20 of 26 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 9 have no contract verdict; 11 failures of our instrument; 6 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/2103.13841.json · badge: /api/ran/2103.13841.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
tmlr-group/CoPA community
Papers with Code archive
11 ran · 1 no recorded run
tmlr-group/mokd community (classifier label)
classifier basis not recorded on the link
8 ran · 4 no recorded run
VICO-UoE/URL marked official in Papers with Code
Papers with Code archive
1 ran · 0 no recorded run
vico-uoe/universalrepresentations community
Papers with Code archive
0 ran · 1 no recorded run
FunctionStatusWhere it lives
apply_selection Ran
ran; our contract draft was wrong, not the code
tmlr-group/CoPA/models/pa.py
code served (permissive licence) · get_code("7e968a05de2ba8b3")
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 2, dtype family float, shape (2, 20) 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
import torch.nn as nn

torch.manual_seed(0)

# Create features tensor: (batch_size=2, channels=3, height=4, width=4)
features = torch.randn(2, 3, 4, 4)

# Create vartheta as a list containing a conv2d weight tensor
# For F.conv2d to work, we need a weight tensor of shape (out_channels, in_channels, kernel_h, kernel_w)
# features has 3 input channels, let's use 5 output channels with 3x3 kernel
conv_weight = torch.randn(5, 3, 3, 3)
vartheta = [conv_weight]

ARGS = {
    "features": features,
    "vartheta": vartheta,
}
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 2, dtype family float, shape (2, 20) — shape (2, 20) 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
cal_dist Ran
ran on a synthesized input
tmlr-group/mokd/models/losses.py
code served (permissive licence) · get_code("68e3d9ea3b5a4b42")
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 0, dtype family float, shape () 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)

# Create two small tensors for inputs and inputs_center
# The function uses .size(0) to get batch size and performs operations assuming
# both tensors have the same batch dimension
batch_size = 2
feature_dim = 4

inputs = torch.randn(batch_size, feature_dim)
inputs_center = torch.randn(batch_size, feature_dim)

ARGS = {
    "inputs": inputs,
    "inputs_center": inputs_center,
}
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 0, dtype family float, shape () — shape () 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
centering Ran
ran; our contract draft was wrong, not the code
tmlr-group/CoPA/models/pa.py
code served (permissive licence) · get_code("122da5c3e4363856")
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 2, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 as nn

torch.manual_seed(0)

# The function expects K to be a tensor with size(0) method
# It performs matrix operations: mm (matrix multiply), eye, ones
# The tensor needs to support .cuda() calls but we'll pass CPU tensors
# The function will fail at .cuda() which is expected behavior

# Create a small kernel/gram matrix
K = torch.randn(2, 2)

ARGS = {
    "K": K
}
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 2, dtype family float — no output shape is stated: observe_signature.py could not observe it (call:AssertionError)
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
compute_avg_prototypes Ran
ran; our contract draft was wrong, not the code
tmlr-group/CoPA/models/pa.py
code served (permissive licence) · get_code("fa075e62a49c4713")
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 2, dtype family float, shape (2, 60) 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)

# Create small embeddings tensor with shape [num_batch, c, h, w]
# Using distinct dimensions: batch=2, channels=4, height=3, width=5
embeddings = torch.randn(2, 4, 3, 5)

# Create labels tensor with shape [num_batch, ]
# Labels should be integers from 0 to num_classes-1
labels = torch.tensor([0, 1], dtype=torch.long)

# is_flatten parameter
is_flatten = True

ARGS = {
    "embeddings": embeddings,
    "labels": labels,
    "is_flatten": is_flatten,
}
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 2, dtype family float, shape (2, 60) — shape (2, 60) 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
compute_max_prototype Ran
ran; our contract draft was wrong, not the code
tmlr-group/CoPA/models/pa.py
code served (permissive licence) · get_code("bfdceee8e94ba8ee")
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 2, dtype family float, shape (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)

# Create embeddings: shape (batch_size, embedding_dim)
# Using distinct dimensions: 6 samples, 4 embedding dimensions
embeddings = torch.randn(6, 4, dtype=torch.float32)

# Create labels: 3 classes (n_way=3), with 2 samples per class
# Labels should be integers from 0 to n_way-1
labels = torch.tensor([0, 0, 1, 1, 2, 2], dtype=torch.long)

ARGS = {
    "embeddings": embeddings,
    "labels": labels,
}
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 2, dtype family float, shape (3, 4) — shape (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
compute_most_sim_prototype Ran
ran; our contract draft was wrong, not the code
tmlr-group/CoPA/models/pa.py
code served (permissive licence) · get_code("7bc0c018da29b173")
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 2, dtype family float, shape (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)

# Create small embeddings tensor: (num_samples, embedding_dim)
# Using shape (6, 4) to have 6 samples with 4-dimensional embeddings
embeddings = torch.randn(6, 4, dtype=torch.float32)

# Create labels tensor with 3 classes (n_way=3)
# Labels should indicate which class each embedding belongs to
labels = torch.tensor([0, 0, 1, 1, 2, 2], dtype=torch.long)

ARGS = {
    "embeddings": embeddings,
    "labels": labels,
}
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 2, dtype family float, shape (3, 4) — shape (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
compute_sum_prototype Ran
ran; our contract draft was wrong, not the code
tmlr-group/CoPA/models/pa.py
code served (permissive licence) · get_code("8c6dd9a5516475ee")
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 2, dtype family float, shape (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)

# Create small embeddings tensor: shape (batch_size, embedding_dim)
# Using batch_size=6, embedding_dim=4
embeddings = torch.randn(6, 4, dtype=torch.float32)

# Create labels tensor with 3 unique classes (n_way=3)
# Labels should be integers from 0 to n_way-1
labels = torch.tensor([0, 0, 1, 1, 2, 2], dtype=torch.long)

# is_flatten parameter
is_flatten = True

ARGS = {
    "embeddings": embeddings,
    "labels": labels,
    "is_flatten": is_flatten,
}
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 2, dtype family float, shape (3, 4) — shape (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
cross_entropy_loss Ran
ran; our contract draft was wrong, not the code
tmlr-group/CoPA/models/pa.py
code served (permissive licence) · get_code("ab00127e0e9d1905")
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)

# Create small tensors for the function
# logits: shape (batch_size=2, num_classes=4) - raw model outputs
logits = torch.randn(2, 4)

# targets: shape (batch_size=2,) - ground truth class indices
# Using values in range [0, 4) to match number of classes
targets = torch.tensor([0, 2], dtype=torch.float32)

ARGS = {
    'logits': logits,
    'targets': targets,
}
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
get_optimizer Ran
ran on a synthesized input
tmlr-group/mokd/models/model_helpers.py
code served (permissive licence) · get_code("94d7d1aa90bc2d6f")
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 Adam. 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 minimal model with parameters
class TinyModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

model = TinyModel()

ARGS = {
    'model': model,
    'args': {
        'train.learning_rate': 0.001,
        'train.weight_decay': 1e-4,
        'train.optimizer': 'adam',
        'train.nesterov_momentum': True,
    },
    'params': None,
}
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 Adam — a Adam output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Adam 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
imq Ran
ran on a synthesized input
tmlr-group/mokd/models/hsic_estimation.py
code served (permissive licence) · get_code("d2e93fa24f8623c1")
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 2, dtype family float, shape (2, 2) 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)

# X is used in unsqueeze operations and arithmetic, so it needs to be a 2D tensor
# The function computes pairwise distances, so X should be (batch_size, features)
X = torch.randn(2, 4)

# scale is used in multiplication and sqrt operations
# It should be a positive scalar
scale = 1.5

ARGS = {
    "X": X,
    "scale": scale,
}
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 2, dtype family float, shape (2, 2) — shape (2, 2) 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
kernel_CKA Ran
ran; our contract draft was wrong, not the code
tmlr-group/CoPA/models/pa.py
code served (permissive licence) · get_code("b1de118bad80d84f")
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 Tensor, ndim 0, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 math

torch.manual_seed(0)

# Create small tensors for X and Y
# X and Y should be 2D tensors where rows are samples and columns are features
X = torch.randn(2, 4)  # 2 samples, 4 features
Y = torch.randn(2, 4)  # 2 samples, 4 features

# sigma can be None (will be computed) or a float value
sigma = None

ARGS = {
    "X": X,
    "Y": Y,
    "sigma": sigma
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 0, dtype family float — no output shape is stated: observe_signature.py could not observe it (call:AssertionError)
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
kernel_HSIC Ran
ran; our contract draft was wrong, not the code
tmlr-group/CoPA/models/pa.py
code served (permissive licence) · get_code("c1fa4a28c0967388")
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 0, dtype family float; no output shape is stated. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 math

torch.manual_seed(0)

# Create small tensors for X and Y
# X and Y are used in rbf() which calls torch.mm(X, X.transpose(0, 1))
# So they need to be 2D tensors. Keep them tiny: batch_size=2, features=4
X = torch.randn(2, 4)
Y = torch.randn(2, 4)

# sigma is a float parameter
sigma = 1.0

ARGS = {
    "X": X,
    "Y": Y,
    "sigma": sigma,
}
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 0, dtype family float — no output shape is stated: observe_signature.py could not observe it (call:AssertionError)
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
labels_to_episode_labels Ran
ran on a synthesized input
tmlr-group/mokd/models/model_utils.py
code served (permissive licence) · get_code("42107d08a8a749ec")
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 1, dtype family float, shape (6,) 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)

# Create a small tensor with class labels
# Using values 0, 1, 2 to represent different classes
labels = torch.tensor([0, 1, 0, 2, 1, 2], dtype=torch.long)

ARGS = {
    "labels": labels
}
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 1, dtype family float, shape (6,) — shape (6,) 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
linear Ran
ran on a synthesized input
tmlr-group/mokd/models/hsic_estimation.py
code served (permissive licence) · get_code("dd2fbf6ed2260eae")
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 2, dtype family float, shape (2, 2) 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)

# Create a small tensor with distinct dimensions (2 rows, 4 columns)
X = torch.randn(2, 4)

ARGS = {
    "X": X
}
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 2, dtype family float, shape (2, 2) — shape (2, 2) 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
linear_HSIC Ran
ran on a synthesized input
tmlr-group/mokd/models/cka.py
code served (permissive licence) · get_code("78c17a9df7b56d4d")
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 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 linear_HSIC takes two tensors X and Y
# It performs matrix multiplication and centering operations
# Both X and Y should be 2D tensors where:
# - X.mm(X.transpose(0,1)) produces an n×n matrix
# - Y.mm(Y.transpose(0,1)) produces an n×n matrix
# So X and Y should have the same first dimension (n)

n = 2  # batch size
d_x = 4  # feature dimension for X
d_y = 3  # feature dimension for Y (different from d_x for clarity)

X = torch.randn(n, d_x)
Y = torch.randn(n, d_y)

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 0, dtype family float, shape () — shape () 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
pa Ran
ran on a synthesized input
VICO-UoE/URL/models/tsa.py
code served (permissive licence) · get_code("8f26f9f0da493c06")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 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
import torch.nn as nn
import torch.nn.functional as F

class pa(nn.Module):
    """ 
    pre-classifier alignment (PA) mapping from 'Universal Representation Learning from Multiple Domains for Few-shot Classification'
    (https://arxiv.org/pdf/2103.13841.pdf)
    """

    def __init__(self, feat_dim):
        super(pa, self).__init__()
        self.weight = nn.Parameter(torch.ones(feat_dim, feat_dim, 1, 1))
        self.weight.requires_grad = True

    def forward(self, x):
        if len(list(x.size())) == 2:
            x = x.unsqueeze(-1).unsqueeze(-1)
        x = F.conv2d(x, self.weight.to(x.device)).flatten(1)
        return x


INIT_ARGS = {
    'feat_dim': 4
}

ARGS = {
    'x': torch.randn(2, 4)
}

if __name__ == '__main__':
    model = pa(**INIT_ARGS)
    output = model(**ARGS)
    print(f"Input shape: {ARGS['x'].shape}")
    print(f"Output shape: {output.shape}")
    print(f"Output: {output}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
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 2, dtype family float, shape (2, 4) — shape (2, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
prototype_loss Ran
ran; our contract draft was wrong, not the code
tmlr-group/CoPA/models/pa.py
code served (permissive licence) · get_code("3e380e81bdaa50cd")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 as nn

torch.manual_seed(0)

# Create tiny support embeddings: [num_support, embedding_dim]
support_embeddings = torch.randn(4, 8)

# Create support labels: [num_support]
support_labels = torch.tensor([0, 0, 1, 1], dtype=torch.long)

# Create tiny query embeddings: [num_query, embedding_dim]
query_embeddings = torch.randn(2, 8)

# Create query labels: [num_query]
query_labels = torch.tensor([0, 1], dtype=torch.long)

# Define distance metric
distance = 'cos'

# Define prototype type
prot_type = 'avg'

ARGS = {
    'support_embeddings': support_embeddings,
    'support_labels': support_labels,
    'query_embeddings': query_embeddings,
    'query_labels': query_labels,
    'distance': distance,
    'prot_type': prot_type
}
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
rbf Ran
ran; our contract draft was wrong, not the code
tmlr-group/CoPA/models/pa.py
code served (permissive licence) · get_code("ad1380889172ec1f")
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 2, dtype family float, shape (2, 2) 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
import math

torch.manual_seed(0)

# Create a small tensor for X
# The function uses X in torch.mm(X, X.transpose(0, 1))
# So X should be 2D: (n_samples, n_features)
X = torch.randn(2, 4)

ARGS = {
    "X": X,
    "sigma": None,
}
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 2, dtype family float, shape (2, 2) — shape (2, 2) 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
rbf Ran
ran on a synthesized input
tmlr-group/mokd/models/cka.py
code served (permissive licence) · get_code("1dddaffd3ae4142f")
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 2, dtype family float, shape (2, 2) 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
import math

torch.manual_seed(0)

# Create a small input tensor
# X should be a 2D tensor where we compute pairwise RBF kernel
# Shape: (n_samples, n_features)
X = torch.randn(2, 4)

# sigma can be None (will be computed from median distance) or a float
sigma = None

ARGS = {
    "X": X,
    "sigma": sigma,
}
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 2, dtype family float, shape (2, 2) — shape (2, 2) 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
rbf Ran
ran on a synthesized input
tmlr-group/mokd/models/hsic_estimation.py
code served (permissive licence) · get_code("29877c45faa57d6f")
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 2, dtype family float, shape (2, 2) 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
import math

torch.manual_seed(0)

# Create a small sample tensor for X
# The function performs matrix operations and computes an RBF kernel
# X should be a 2D tensor of shape (n_samples, n_features)
X = torch.randn(2, 4)

# Define all parameters for the rbf function
ARGS = {
    'X': X,
    'stat_mode': 'median',
    'scale': torch.tensor(1.0),
    'q_quantile': 0.25
}
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 2, dtype family float, shape (2, 2) — shape (2, 2) 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
ResNet Not yet run
unverified (harvested, no recorded run)
vico-uoe/universalrepresentations/VisualDecathlon/models.py
code served (permissive licence) · get_code("ffad41c1ddd8d6c1")
How it ran

no invocation recorded.

cal_dist_cosine Not yet run
unverified (harvested, no recorded run)
tmlr-group/mokd/models/losses.py
code served (permissive licence) · get_code("1700ff73ab4e452a")
How it ran

no invocation recorded.

compute_prototypes Not yet run
unverified (harvested, no recorded run)
tmlr-group/mokd/hsic_loss.py
code served (permissive licence) · get_code("fad178676f5c5101")
How it ran

no invocation recorded.

cosine_sim Not yet run
unverified (harvested, no recorded run)
tmlr-group/mokd/models/model_utils.py
code served (permissive licence) · get_code("28cc87a06ba68afb")
How it ran

no invocation recorded.

pa Not yet run
unverified (harvested, no recorded run)
tmlr-group/CoPA/models/pa.py
code served (permissive licence) · get_code("3990fde51995b22c")
How it ran

no invocation recorded.

pred_with_protos Not yet run
unverified (harvested, no recorded run)
tmlr-group/mokd/hsic_loss.py
code served (permissive licence) · get_code("549d8369236aee08")
How it ran

no invocation recorded.

Also present in other papers' code

Of 26 samples lifted from this paper's linked repositories, 26 carry a function identity and 0 do not. Of the 25 distinct functions with an identity, 2 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 1 later) and 23 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
cross_entropy_loss
brick of this paper's assembly: helper
2 other papers
1 dated earlier, 1 later · 1 only as an assembly brick
2003.09338 (2020-03)
Selecting Relevant Features from a Multi-domain Representation for Few-shot Classification
2303.06315 (2023-03)
DETA: Denoised Task Adaptation for Few-Shot Learning
cosine_sim 1 other paper
1 dated earlier
2003.09338 (2020-03)
Selecting Relevant Features from a Multi-domain Representation for Few-shot Classification

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

In this paper, we look at the problem of few-shot image classification that aims to learn a classifier for previously unseen classes and domains from few labeled samples. Recent methods use various adaptation strategies for aligning their visual representations to new domains or select the relevant ones from multiple domain-specific feature extractors. In this work, we present URL, which learns a single set of universal visual representations by distilling knowledge of multiple domain-specific networks after co-aligning their features with the help of adapters and centered kernel alignment. We show that the universal representations can be further refined for previously unseen domains by an efficient adaptation step in a similar spirit to distance learning methods. We rigorously evaluate our model in the recent Meta-Dataset benchmark and demonstrate that it significantly outperforms the previous methods while being more efficient.

For agents

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

get_harvested_code_for_paper("2103.13841")
get_code_for_paper("2103.13841")
have("2103.13841")

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

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

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

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

Connect an agent — have() is free.