SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1905.01102 · 2019

Generating Classification Weights with GNN Denoising Autoencoders for Few-Shot Learning

arXiv · PDF · Open in the Atlas

Code that ran

7 of 8 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 6 have no contract verdict; 1 failure 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/1905.01102.json · badge: /api/ran/1905.01102.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
gidariss/wDAE_GNN_FewShot canonical (classifier label)
classifier basis: census
7 ran · 1 no recorded run
FunctionStatusWhere it lives
buildLabelIndex Ran
ran; our contract draft was wrong, not the code
gidariss/wDAE_GNN_FewShot/low_shot_learning/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from valeoai/moca, is pointer only (licence: NOASSERTION) · get_code("57889d72f516d105")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from valeoai/moca, and GitHub could not classify the licence of that repository (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.

convertImgFromNormalizedTensorToUint8Numpy Ran
ran on a synthesized input
gidariss/wDAE_GNN_FewShot/low_shot_learning/utils.py
code served (permissive licence) · get_code("89d139765fc146a3")
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 int, shape (4, 5, 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
import numpy as np

torch.manual_seed(0)

# Create a normalized image tensor with shape (3, 4, 5)
# Channel dimension is 3, height is 4, width is 5
image = torch.randn(3, 4, 5)

# Normalize the image to be in roughly [-1, 1] range for realistic values
image = image / 2

# Create mean and std for each channel
mean = torch.tensor([0.485, 0.456, 0.406])
std = torch.tensor([0.229, 0.224, 0.225])

ARGS = {
    "image": image,
    "mean": mean,
    "std": std,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — 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 int, shape (4, 5, 3) — shape (4, 5, 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
extract_features Ran
ran on a synthesized input
gidariss/wDAE_GNN_FewShot/low_shot_learning/algorithms/classification/utils.py
code served (permissive licence) · get_code("7c7f583a37437002")
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 torch
import torch.nn as nn

torch.manual_seed(0)

class MockFeatureExtractor(nn.Module):
    """A minimal feature extractor that supports out_feat_keys parameter."""
    
    def __init__(self):
        super().__init__()
        self.layer1 = nn.Linear(4, 8)
        self.layer2 = nn.Linear(8, 16)
    
    def forward(self, images, out_feat_keys=None):
        # Process images through layers
        x = self.layer1(images)
        x = self.layer2(x)
        
        if out_feat_keys:
            # Return a dict with requested feature keys
            if isinstance(out_feat_keys, str):
                out_feat_keys = [out_feat_keys]
            features = {}
            for key in out_feat_keys:
                features[key] = x
            return features
        else:
            # Return features directly
            return x

# Create instances
feature_extractor = MockFeatureExtractor()
images = torch.randn(2, 4)  # batch_size=2, feature_dim=4
feature_name = "conv_layer"

ARGS = {
    "feature_extractor": feature_extractor,
    "images": images,
    "feature_name": feature_name,
}
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 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
few_shot_feature_classification Ran
ran on a synthesized input
gidariss/wDAE_GNN_FewShot/low_shot_learning/algorithms/fewshot/utils.py
code served (permissive licence) · get_code("729c95479e7e7b73")
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. 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)

class SimpleClassifier(nn.Module):
    def __init__(self, feature_dim=4, num_classes=3):
        super().__init__()
        self.feature_dim = feature_dim
        self.num_classes = num_classes
    
    def forward(self, features_test, features_train, labels_train, base_ids=None):
        batch_size = features_test.size(0)
        num_test = features_test.size(1)
        
        scores = torch.randn(batch_size, num_test, self.num_classes)
        return scores

classifier = SimpleClassifier(feature_dim=4, num_classes=3)

batch_size = 2
num_test_samples = 3
num_train_samples = 5
feature_dim = 4
num_classes = 3

features_test = torch.randn(batch_size, num_test_samples, feature_dim)
features_train = torch.randn(batch_size, num_train_samples, feature_dim)
labels_train_1hot = torch.zeros(batch_size, num_train_samples, num_classes)
labels_train_1hot.scatter_(2, torch.randint(0, num_classes, (batch_size, num_train_samples, 1)), 1)

labels_test = torch.randint(0, num_classes, (batch_size, num_test_samples))

base_ids = None

ARGS = {
    'classifier': classifier,
    'features_test': features_test,
    'features_train': features_train,
    'labels_train_1hot': labels_train_1hot,
    'labels_test': labels_test,
    'base_ids': base_ids
}
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 — a tuple output has no array shape of its own; none is 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
load_features_labels Ran
ran on a synthesized input
gidariss/wDAE_GNN_FewShot/low_shot_learning/datasets/mini_imagenet_dataset.py
code served (permissive licence) · get_code("a932df89602afdb0")
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. 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 h5py
import tempfile
import os
import numpy as np

# Create a temporary HDF5 file with the required structure
temp_dir = tempfile.mkdtemp()
dataset_file = os.path.join(temp_dir, 'test_dataset.h5')

with h5py.File(dataset_file, 'w') as f:
    # Store count as a dataset with shape (1,)
    f.create_dataset('count', data=np.array([3]))
    
    # Create all_features dataset with shape (5, 4)
    # Using 5 rows to have more than count, so slicing [:count, :] makes sense
    features_data = np.random.randn(5, 4).astype(np.float32)
    f.create_dataset('all_features', data=features_data)
    
    # Create all_labels dataset with shape (5,)
    labels_data = np.array([0, 1, 1, 0, 1], dtype=np.int32)
    f.create_dataset('all_labels', data=labels_data)

ARGS = {
    'dataset_file': dataset_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
h5py, numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple — a tuple output has no array shape of its own; none is 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
load_pickle_data Ran
ran on a synthesized input
gidariss/wDAE_GNN_FewShot/low_shot_learning/utils.py
code served (permissive licence) · get_code("220bb097ca9d20d2")
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 pickle
import tempfile
import os

# Create a temporary pickle file with test data
temp_dir = tempfile.gettempdir()
temp_file = os.path.join(temp_dir, "test_data.pkl")

# Create sample data with byte keys (common in Python 2 pickles)
test_data = {
    b'key1': [1, 2, 3],
    b'key2': {'nested': 'value'},
    b'key3': 42
}

# Write the test data to a pickle file
with open(temp_file, 'wb') as f:
    pickle.dump(test_data, f)

ARGS = {
    'file': temp_file
}
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
softmax_with_novel_prior Ran
ran on a synthesized input
gidariss/wDAE_GNN_FewShot/low_shot_learning/algorithms/fewshot/imagenet_lowshot.py
code served (permissive licence) · get_code("9480141f35f83ef2")
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, 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 tensors for the function
batch_size = 2
num_classes = 4

# scores: shape (batch_size, num_classes) - log probabilities
scores = torch.randn(batch_size, num_classes)

# novel_inds: indices of novel classes
novel_inds = [0, 1]

# base_inds: indices of base classes
base_inds = [2, 3]

# prior_m: prior weight for novel classes (float between 0 and 1)
prior_m = 0.6

ARGS = {
    "scores": scores,
    "novel_inds": novel_inds,
    "base_inds": base_inds,
    "prior_m": prior_m,
}
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, 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: none by the harness; any seed is in the setup block
compute_top1_and_top5_accuracy Not yet run
unverified (harvested, no recorded run)
gidariss/wDAE_GNN_FewShot/low_shot_learning/algorithms/fewshot/imagenet_lowshot.py
code served (permissive licence) · get_code("0579910fda20b6c9")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 1 later) and 5 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
buildLabelIndex 6 other papers
2 dated earlier, 4 later
1803.07728 (2018-03)
Unsupervised Representation Learning by Predicting Image Rotations
1804.09458 (2018-04)
Dynamic Few-Shot Visual Learning without Forgetting
1906.02944 (2019-06)
Learning Adaptive Classifiers Synthesis for Generalized Few-Shot Learning
and 3 more not named here
compute_top1_and_top5_accuracy 1 other paper
1 dated earlier
1804.09458 (2018-04)
Dynamic Few-Shot Visual Learning without Forgetting
softmax_with_novel_prior 1 other paper
1 dated earlier
1804.09458 (2018-04)
Dynamic Few-Shot Visual Learning without Forgetting

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

Given an initial recognition model already trained on a set of base classes, the goal of this work is to develop a meta-model for few-shot learning. The meta-model, given as input some novel classes with few training examples per class, must properly adapt the existing recognition model into a new model that can correctly classify in a unified way both the novel and the base classes. To accomplish this goal it must learn to output the appropriate classification weight vectors for those two types of classes. To build our meta-model we make use of two main innovations: we propose the use of a Denoising Autoencoder network (DAE) that (during training) takes as input a set of classification weights corrupted with Gaussian noise and learns to reconstruct the target-discriminative classification weights. In this case, the injected noise on the classification weights serves the role of regularizing the weight generating meta-model. Furthermore, in order to capture the co-dependencies between different classes in a given task instance of our meta-model, we propose to implement the DAE model as a Graph Neural Network (GNN). In order to verify the efficacy of our approach, we extensively evaluate it on ImageNet based few-shot benchmarks and we report strong results that surpass prior approaches. The code and models of our paper will be published on: https://github.com/gidariss/wDAE_GNN_FewShot

For agents

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

get_harvested_code_for_paper("1905.01102")
get_code_for_paper("1905.01102")
have("1905.01102")

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

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

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

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

Connect an agent — have() is free.