SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2302.05080 · ICLR · 2023

Long-Tailed Partial Label Learning via Dynamic Rebalancing

Ya Zhang, Zhihan Zhou, Jiangchao Yao, Yanfeng Wang, Feng Hong

arXiv · PDF · Open in the Atlas

Code that ran

1 of 1 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; 0 failures of our instrument; 0 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/2302.05080.json · badge: /api/ran/2302.05080.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
mediabrain-sjtu/records-ltpll canonical (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
Proden_loss_RECORDS Ran
ran on a synthesized input · constructed an object; no result was computed
mediabrain-sjtu/records-ltpll/utils/utils_loss.py
code served (permissive licence) · get_code("281096e1d6674a7e")
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, Proden_loss_RECORDS: 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
import torch.nn.functional as F

torch.manual_seed(0)

# Build a minimal model that has module.fc attribute
class SimpleFC(nn.Module):
    def __init__(self, input_dim, num_classes):
        super().__init__()
        self.fc = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        return self.fc(x)

class SimpleModel(nn.Module):
    def __init__(self, input_dim, num_classes):
        super().__init__()
        self.module = SimpleFC(input_dim, num_classes)
    
    def forward(self, x):
        return self.module(x)

# Create parameters
batch_size = 2
num_classes = 3
feat_dim = 4
num_samples = 5

# Create target confidence matrix (for entire dataset)
target_confidence = torch.rand(num_samples, num_classes)
target_confidence = target_confidence / target_confidence.sum(dim=1, keepdim=True)

# Create model
model = SimpleModel(input_dim=feat_dim, num_classes=num_classes)

# Create loss module
loss_module = nn.Module.__new__(type('Proden_loss_RECORDS', (nn.Module,), {
    '__init__': lambda self, target: (super(type(self), self).__init__(), setattr(self, 'confidence', target), setattr(self, 'feat_mean', None)),
    'forward': lambda self, output1, feat, model, index, update_target=True: forward_impl(self, output1, feat, model, index, update_target)
}))

def forward_impl(self, output1, feat, model, index, update_target=True):
    output = F.softmax(output1, dim=1)
    target = self.confidence[index, :]
    l = target * torch.log(output)
    loss = -torch.sum(l) / l.size(0)
    if self.feat_mean is None:
        self.feat_mean = 0.1 * feat.detach().mean(0)
    else:
        self.feat_mean = 0.9 * self.feat_mean + 0.1 * feat.detach().mean(0)
    if update_target:
        bias = model.module.fc(self.feat_mean.unsqueeze(0)).detach()
        bias = F.softmax(bias, dim=1)
        logits = output1 - torch.log(bias + 1e-09)
        output = F.softmax(logits, dim=1)
        revisedY = target.clone()
        revisedY[revisedY > 0] = 1
        revisedY = revisedY * output
        revisedY = revisedY / revisedY.sum(dim=1).repeat(revisedY.size(1), 1).transpose(0, 1)
        new_target = revisedY
        self.confidence[index, :] = new_target.detach()
    return loss

# Properly construct the loss module using the actual class
class Proden_loss_RECORDS(nn.Module):
    def __init__(self, target):
        super().__init__()
        self.confidence = target
        self.feat_mean = None

    def forward(self, output1, feat, model, index, update_target=True):
        output = F.softmax(output1, dim=1)
        target = self.confidence[index, :]
        l = target * torch.log(output)
        loss = -torch.sum(l) / l.size(0)
        if self.feat_mean is None:
            self.feat_mean = 0.1 * feat.detach().mean(0)
        else:
            self.feat_mean = 0.9 * self.feat_mean + 0.1 * feat.detach().mean(0)
        if update_target:
            bias = model.module.fc(self.feat_mean.unsqueeze(0)).detach()
            bias = F.softmax(bias, dim=1)
            logits = output1 - torch.log(bias + 1e-09)
            output = F.softmax(logits, dim=1)
            revisedY = target.clone()
            revisedY[revisedY > 0] = 1
            revisedY = revisedY * output
            revisedY = revisedY / revisedY.sum(dim=1).repeat(revisedY.size(1), 1).transpose(0, 1)
            new_target = revisedY
            self.confidence[index, :] = new_target.detach()
        return loss

loss_module = Proden_loss_RECORDS(target_confidence)

# Create input tensors
output1 = torch.randn(batch_size, num_classes)
feat = torch.randn(batch_size, feat_dim)
index = torch.tensor([0, 2])

ARGS = {
    'target': target_confidence,
}
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 Proden_loss_RECORDS — 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 Proden_loss_RECORDS 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

Also present in other papers' code

Of 1 samples lifted from this paper's linked repositories, 1 carry a function identity and 0 do not. Of the 1 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 1 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

Real-world data usually couples the label ambiguity and heavy imbalance, challenging the algorithmic robustness of partial label learning (PLL) and long-tailed learning (LT). The straightforward combination of LT and PLL, i.e., LT-PLL, suffers from a fundamental dilemma: LT methods build upon a given class distribution that is unavailable in PLL, and the performance of PLL is severely influenced in long-tailed context. We show that even with the auxiliary of an oracle class prior, the state-of-the-art methods underperform due to an adverse fact that the constant rebalancing in LT is harsh to the label disambiguation in PLL. To overcome this challenge, we thus propose a dynamic rebalancing method, termed as RECORDS, without assuming any prior knowledge about the class distribution. Based on a parametric decomposition of the biased output, our method constructs a dynamic adjustment that is benign to the label disambiguation process and theoretically converges to the oracle class prior. Extensive experiments on three benchmark datasets demonstrate the significant gain of RECORDS compared with a range of baselines. The code is publicly available.

For agents

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

get_harvested_code_for_paper("2302.05080")
get_code_for_paper("2302.05080")
have("2302.05080")

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

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

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

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

Connect an agent — have() is free.