SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2208.10930 · 2022

FS-BAN: Born-Again Networks for Domain Generalization Few-Shot Classification

arXiv · PDF · Open in the Atlas

Code that ran

9 of 14 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; 2 honoured the contract we drafted, 0 violated it and 3 have no contract verdict; 4 failures of our instrument; 5 no recorded run), measured 2026-11-23; 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/2208.10930.json · badge: /api/ran/2208.10930.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
yunqing-me/Born-Again-FS canonical (classifier label)
classifier basis not recorded on the link
9 ran · 5 no recorded run
FunctionStatusWhere it lives
DBindex Ran
ran, honoured the contract we drafted
yunqing-me/Born-Again-FS/baseline_model/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from zoilsen/flor, is pointer only (licence: NONE) · get_code("c43e6e5f82ef6a4c")
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 zoilsen/flor, and GitHub detected no licence in that repository 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_assigned_file Ran
ran; our contract draft was wrong, not the code
yunqing-me/Born-Again-FS/baseline_model/options.py
pointer only (licence: MIT); the stored copy get_code serves, from zoilsen/flor, is pointer only (licence: NONE) · get_code("400a8db2fb9b1633")
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 zoilsen/flor, and GitHub detected no licence in that repository 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_resume_file Ran
ran; our contract draft was wrong, not the code
yunqing-me/Born-Again-FS/baseline_model/options.py
pointer only (licence: MIT); the stored copy get_code serves, from zoilsen/flor, is pointer only (licence: NONE) · get_code("7b02b06c5ac04f3d")
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 zoilsen/flor, and GitHub detected no licence in that repository 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.

one_hot Ran
ran; our contract draft was wrong, not the code
yunqing-me/Born-Again-FS/baseline_model/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from tinkez/fap_cdfsc, is pointer only (licence: NONE) · get_code("f1324589fc273593")
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 tinkez/fap_cdfsc, and GitHub detected no licence in that repository 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.

softplus Ran
ran; our contract draft was wrong, not the code
yunqing-me/Born-Again-FS/baseline_model/methods/backbone.py
pointer only (licence: MIT); the stored copy get_code serves, from hytseng0509/CrossDomainFewShot, is pointer only (licence: NONE) · get_code("938085d32a386023")
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 hytseng0509/CrossDomainFewShot, and GitHub detected no licence in that repository 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.

sparsity Ran
ran, honoured the contract we drafted
yunqing-me/Born-Again-FS/baseline_model/utils.py
pointer only (licence: MIT); the stored copy get_code serves, from zoilsen/flor, is pointer only (licence: NONE) · get_code("de09514deda6f881")
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 zoilsen/flor, and GitHub detected no licence in that repository 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.

train Ran
ran on a synthesized input
yunqing-me/Born-Again-FS/baseline_model/pretrain.py
code served (permissive licence) · get_code("70dfd49412a04d63")
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 MinimalModel. 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
import tempfile
import os

torch.manual_seed(0)

# Create a minimal model that implements the train_loop method
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)
    
    def train_loop(self, epoch, base_loader, optimizer, total_it):
        for batch_idx, (x, y) in enumerate(base_loader):
            optimizer.zero_grad()
            output = self.forward(x)
            loss = nn.functional.mse_loss(output, y)
            loss.backward()
            optimizer.step()
            total_it += 1
        return total_it

# Create a minimal data loader (list of (x, y) tuples)
base_loader = [
    (torch.randn(2, 4), torch.randn(2, 3)),
    (torch.randn(2, 4), torch.randn(2, 3)),
]

# Create model
model = MinimalModel()

# Create a temporary directory for checkpoints
checkpoint_dir = tempfile.mkdtemp()

# Create a params config object with required attributes
class ParamsConfig:
    def __init__(self, checkpoint_dir):
        self.checkpoint_dir = checkpoint_dir
        self.save_freq = 2

params = ParamsConfig(checkpoint_dir)

# Define the arguments
ARGS = {
    'base_loader': base_loader,
    'model': model,
    'start_epoch': 0,
    'stop_epoch': 3,
    'params': params
}
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 MinimalModel — a MinimalModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MinimalModel 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
train Ran
ran on a synthesized input
yunqing-me/Born-Again-FS/baseline_model/train_baseline.py
code served (permissive licence) · get_code("13a767c65a8c43dc")
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 MinimalModel. 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
import tempfile

torch.manual_seed(0)

# Create a minimal model that implements the required methods
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)
    
    def forward(self, x):
        return self.linear(x)
    
    def train_loop(self, epoch, base_loader, optimizer, total_it):
        # Minimal train_loop implementation
        for batch_x, batch_y in base_loader:
            optimizer.zero_grad()
            logits = self.forward(batch_x)
            loss = nn.functional.cross_entropy(logits, batch_y)
            loss.backward()
            optimizer.step()
            total_it += 1
        return total_it
    
    def test_loop(self, val_loader):
        # Minimal test_loop that returns accuracy
        correct = 0
        total = 0
        with torch.no_grad():
            for batch_x, batch_y in val_loader:
                logits = self.forward(batch_x)
                preds = logits.argmax(dim=1)
                correct += (preds == batch_y).sum().item()
                total += batch_y.size(0)
        acc = correct / total if total > 0 else 0.0
        return acc

# Create minimal data loaders (list of (x, y) tuples)
base_loader = [
    (torch.randn(2, 4), torch.randint(0, 2, (2,))),
    (torch.randn(2, 4), torch.randint(0, 2, (2,))),
]

val_loader = [
    (torch.randn(2, 4), torch.randint(0, 2, (2,))),
    (torch.randn(2, 4), torch.randint(0, 2, (2,))),
]

# Create model
model = MinimalModel()

# Create params object
class Params:
    def __init__(self):
        self.checkpoint_dir = tempfile.mkdtemp()
        self.save_freq = 1

params = Params()

ARGS = {
    'base_loader': base_loader,
    'val_loader': val_loader,
    'model': model,
    'start_epoch': 0,
    'stop_epoch': 2,
    'params': params,
}
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 MinimalModel — a MinimalModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MinimalModel 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
train Ran
ran on a synthesized input
yunqing-me/Born-Again-FS/baseline_model/train_baseline_distill_gen_1_single.py
code served (permissive licence) · get_code("3f5fdeef3bc69b20")
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 MinimalModel. 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
import tempfile

torch.manual_seed(0)

# Create a minimal model that implements train_loop and state_dict
class MinimalModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)
    
    def train_loop(self, epoch, base_loader, optimizer, total_it, teacher_model):
        for batch_idx, (x, y) in enumerate(base_loader):
            optimizer.zero_grad()
            output = self(x)
            loss = nn.functional.mse_loss(output, y)
            loss.backward()
            optimizer.step()
            total_it += 1
        return total_it

# Create a minimal teacher model
class MinimalTeacherModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.linear(x)

# Create minimal data loader (list of batches)
base_loader = [
    (torch.randn(2, 4), torch.randn(2, 3)),
    (torch.randn(2, 4), torch.randn(2, 3)),
]

# Create model instances
model = MinimalModel()
teacher_model = MinimalTeacherModel()

# Create params object
class Params:
    def __init__(self):
        self.checkpoint_dir = tempfile.mkdtemp()
        self.save_freq = 2

params = Params()

ARGS = {
    'base_loader': base_loader,
    'model': model,
    'teacher_model': teacher_model,
    'start_epoch': 0,
    'stop_epoch': 3,
    'params': params
}
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 MinimalModel — a MinimalModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MinimalModel 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
ResNet10 Not yet run
unverified (harvested, no recorded run)
yunqing-me/Born-Again-FS/baseline_model/methods/backbone.py
code served (permissive licence) · get_code("abced9a48013eeb0")
How it ran

no invocation recorded.

ResNet18 Not yet run
unverified (harvested, no recorded run)
yunqing-me/Born-Again-FS/baseline_model/methods/backbone.py
code served (permissive licence) · get_code("6a349f825361445e")
How it ran

no invocation recorded.

parse_args Not yet run
unverified (harvested, no recorded run)
yunqing-me/Born-Again-FS/baseline_model/options.py
code served (permissive licence) · get_code("1b080a20f55cfd73")
How it ran

no invocation recorded.

train Not yet run
unverified (harvested, no recorded run)
yunqing-me/Born-Again-FS/baseline_model/train_backbone_multi_head.py
code served (permissive licence) · get_code("5e9c3538626f0f95")
How it ran

no invocation recorded.

train Not yet run
unverified (harvested, no recorded run)
yunqing-me/Born-Again-FS/baseline_model/train_baseline_distill_gen_1_multi.py
code served (permissive licence) · get_code("6122e3f1a549c175")
How it ran

no invocation recorded.

Also present in other papers' code

Of 14 samples lifted from this paper's linked repositories, 14 carry a function identity and 0 do not. Of the 14 distinct functions with an identity, 8 are also present in other papers whose code we hold (5 with at least one paper dated earlier, 0 the same month, 8 later) and 6 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
one_hot 5 other papers
1 dated earlier, 4 later
1912.07200 (2019-12)
A Broader Study of Cross-Domain Few-Shot Learning
2403.00567 (2024-03)
Flatten Long-Range Loss Landscapes for Cross-Domain Few-Shot Learning
and 2 more not named here
get_assigned_file 4 other papers
3 dated earlier, 1 later
1905.13613 (2019-05)
Regression Networks for Meta-Learning Few-Shot Classification
1912.07200 (2019-12)
A Broader Study of Cross-Domain Few-Shot Learning
2202.02471 (2022-02)
CLUSTER-INDUCED VORONOI DIAGRAMS: A GEOMETRIC APPROACH
and 1 more not named here
sparsity 4 other papers
1 dated earlier, 3 later
1912.07200 (2019-12)
A Broader Study of Cross-Domain Few-Shot Learning
2403.00567 (2024-03)
Flatten Long-Range Loss Landscapes for Cross-Domain Few-Shot Learning
and 1 more not named here
softplus 3 other papers
1 dated earlier, 2 later
2001.08735 (2020-01)
Cross-Domain Few-Shot Classification via Learned Feature-Wise Transformation
2403.00567 (2024-03)
Flatten Long-Range Loss Landscapes for Cross-Domain Few-Shot Learning
2406.16422 (2024-06)
Exploring Cross-Domain Few-Shot Classification via Frequency-Aware Prompting
DBindex 2 other papers
1 dated earlier, 1 later
1905.13613 (2019-05)
Regression Networks for Meta-Learning Few-Shot Classification
2403.00567 (2024-03)
Flatten Long-Range Loss Landscapes for Cross-Domain Few-Shot Learning
ResNet18 2 other papers
2 later
2403.00567 (2024-03)
Flatten Long-Range Loss Landscapes for Cross-Domain Few-Shot Learning
2406.16422 (2024-06)
Exploring Cross-Domain Few-Shot Classification via Frequency-Aware Prompting
ResNet10 1 other paper
1 later
2406.16422 (2024-06)
Exploring Cross-Domain Few-Shot Classification via Frequency-Aware Prompting
get_resume_file 1 other paper
1 later
2403.00567 (2024-03)
Flatten Long-Range Loss Landscapes for Cross-Domain Few-Shot Learning

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-23.

Repositories linked to this paper

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

Abstract

Conventional Few-shot classification (FSC) aims to recognize samples from novel classes given limited labeled data. Recently, domain generalization FSC (DG-FSC) has been proposed with the goal to recognize novel class samples from unseen domains. DG-FSC poses considerable challenges to many models due to the domain shift between base classes (used in training) and novel classes (encountered in evaluation). In this work, we make two novel contributions to tackle DG-FSC. Our first contribution is to propose Born-Again Network (BAN) episodic training and comprehensively investigate its effectiveness for DG-FSC. As a specific form of knowledge distillation, BAN has been shown to achieve improved generalization in conventional supervised classification with a closed-set setup. This improved generalization motivates us to study BAN for DG-FSC, and we show that BAN is promising to address the domain shift encountered in DG-FSC. Building on the encouraging findings, our second (major) contribution is to propose Few-Shot BAN (FS-BAN), a novel BAN approach for DG-FSC. Our proposed FS-BAN includes novel multi-task learning objectives: Mutual Regularization, Mismatched Teacher, and Meta-Control Temperature, each of these is specifically designed to overcome central and unique challenges in DG-FSC, namely overfitting and domain discrepancy. We analyze different design choices of these techniques. We conduct comprehensive quantitative and qualitative analysis and evaluation over six datasets and three baseline models. The results suggest that our proposed FS-BAN consistently improves the generalization performance of baseline models and achieves state-of-the-art accuracy for DG-FSC. Project Page: https://yunqing-me.github.io/Born-Again-FS/.

For agents

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

get_harvested_code_for_paper("2208.10930")
get_code_for_paper("2208.10930")
have("2208.10930")

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

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

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

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

Connect an agent — have() is free.