SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2203.02496 · 2022

Learning from Label Proportions by Learning with Label Noise

arXiv · PDF · Open in the Atlas

Code that ran

13 of 20 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; 1 honoured the contract we drafted, 0 violated it and 12 have no contract verdict; 0 failures of our instrument; 7 no recorded run); 1 of them was also run on the host, not in the jail, by the peer-agreement lane that set its level, 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/2203.02496.json · badge: /api/ran/2203.02496.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
z-jianxin/llpfc canonical (classifier label)
classifier basis not recorded on the link
13 ran · 7 no recorded run
FunctionStatusWhere it lives
sigmoid_rampup Ran
ran, honoured the contract we drafted
z-jianxin/llpfc/llpvatlib/train_fun.py
code served (permissive licence) · get_code("3fb68ed6809a8085")
How it ran

Ran in Syntology's jail on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. The comparison behind this sample's level is a different run: the peer-agreement lane ran it again on the host, not in the jail (report dated 2026-09-04T23:27:05Z). 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 numpy as np

# The function sigmoid_rampup takes two parameters:
# - current: a numeric value representing the current step/epoch
# - rampup_length: a numeric value representing the total rampup length

ARGS = {
    "current": 5,
    "rampup_length": 10
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, 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
compute_forward_loss_on_minibatch Ran
ran on a synthesized input
z-jianxin/llpfc/llpfclib/train_fun.py
code served (permissive licence) · get_code("8dfaa29133b7b53e")
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
import torch.nn as nn

torch.manual_seed(0)

# Create a simple model that takes images and outputs logits
class SimpleModel(nn.Module):
    def __init__(self, input_size, num_classes):
        super().__init__()
        self.fc = nn.Linear(input_size, num_classes)
    
    def forward(self, x):
        # Flatten if needed and pass through linear layer
        x = x.view(x.size(0), -1)
        return self.fc(x)

# Create a simple loss function that takes prob_corrected, noisy_y, weights, and device
def simple_loss_f(prob_corrected, noisy_y, weights, device):
    # Compute weighted cross entropy loss
    log_prob = torch.log(prob_corrected + 1e-8)
    loss = -torch.sum(weights.unsqueeze(1) * noisy_y * log_prob) / weights.sum()
    return loss

# Setup parameters
batch_size = 2
image_channels = 1
image_height = 4
image_width = 4
num_classes = 3

device = 'cpu'

# Create model
model = SimpleModel(input_size=image_channels * image_height * image_width, num_classes=num_classes)
model = model.to(device)

# Create loss function
loss_f = simple_loss_f

# Create images tensor (batch_size, channels, height, width)
images = torch.randn(batch_size, image_channels, image_height, image_width)

# Create noisy_y tensor (batch_size, num_classes) - soft labels
noisy_y = torch.softmax(torch.randn(batch_size, num_classes), dim=1)

# Create transition matrix (batch_size, num_classes, num_classes)
trans_m = torch.eye(num_classes).unsqueeze(0).repeat(batch_size, 1, 1)
trans_m = trans_m + torch.randn(batch_size, num_classes, num_classes) * 0.01
trans_m = torch.softmax(trans_m, dim=2)

# Create weights tensor (batch_size,)
weights = torch.ones(batch_size)

ARGS = {
    'model': model,
    'loss_f': loss_f,
    'images': images,
    'noisy_y': noisy_y,
    'trans_m': trans_m,
    'weights': weights,
    'device': device
}
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
compute_gen_loss Ran
ran on a synthesized input
z-jianxin/llpfc/llpganlib/train_fun.py
code served (permissive licence) · get_code("998ed6c7658f52b1")
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
import torch.nn as nn
from torch.nn.functional import mse_loss

torch.manual_seed(0)

# Build a minimal discriminator that returns (outputs, features)
class MinimalDiscriminator(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv = nn.Conv2d(3, 8, kernel_size=3, padding=1)
        self.fc = nn.Linear(8 * 4 * 4, 1)
    
    def forward(self, x):
        # x shape: (batch, channel, height, width)
        features = self.conv(x)  # (batch, 8, 4, 4)
        features_flat = features.view(features.size(0), -1)  # (batch, 128)
        outputs = self.fc(features_flat)  # (batch, 1)
        return outputs, features_flat

dis = MinimalDiscriminator()

# Create true_images with shape (batch_size=2, bag_size=3, channel=3, height=4, width=4)
true_images = torch.randn(2, 3, 3, 4, 4)

# Create fake_images with shape (batch_size*bag_size, channel, height, width) = (6, 3, 4, 4)
fake_images = torch.randn(6, 3, 4, 4)

ARGS = {
    "dis": dis,
    "true_images": true_images,
    "fake_images": fake_images
}
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
get_rampup_weight Ran
ran on a synthesized input
z-jianxin/llpfc/llpvatlib/train_fun.py
code served (permissive licence) · get_code("558f680b9d5b46c5")
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 float, 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 numpy as np

ARGS = {
    "weight": 0.5,
    "iteration": 10,
    "rampup": 100
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float, 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
loss_f Ran
ran on a synthesized input
z-jianxin/llpfc/llpfc.py
code served (permissive licence) · get_code("4f39307b536dbec8")
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
import torch.nn as nn

torch.manual_seed(0)

# x: must satisfy simplex constraint (probabilities that sum to 1 across last dim)
# Batch size 2, 4 classes
x = torch.tensor([
    [0.1, 0.2, 0.3, 0.4],
    [0.25, 0.25, 0.25, 0.25]
], dtype=torch.float32)

# y: class indices for NLL loss
# Batch size 2, values must be in [0, 3] (class indices)
y = torch.tensor([3, 1], dtype=torch.long)

# weights: must be broadcastable with unweighted loss (batch size 2)
# and support .sum() and division
weights = torch.tensor([1.0, 2.0], dtype=torch.float32)

# device: CPU
device = torch.device('cpu')

ARGS = {
    'x': x,
    'y': y,
    'weights': weights,
    'device': device,
    'epsilon': 1e-08
}
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
loss_f_test Ran
ran on a synthesized input
z-jianxin/llpfc/llpfc.py
code served (permissive licence) · get_code("bfd8a6f20ee6eba2")
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
import torch.nn as nn

torch.manual_seed(0)

# Create small tensors for x and y
# x should be probabilities (values between 0 and 1)
# y should be class indices (long tensor)
batch_size = 2
num_classes = 4

x = torch.rand(batch_size, num_classes)  # Shape: (2, 4), values in [0, 1]
y = torch.tensor([0, 2], dtype=torch.long)  # Shape: (2,), class indices

device = torch.device('cpu')

ARGS = {
    'x': x,
    'y': y,
    'device': device,
    'epsilon': 1e-08
}
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
loss_f_val Ran
ran on a synthesized input
z-jianxin/llpfc/llpfc.py
code served (permissive licence) · get_code("84f530af9f2aade8")
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
import torch.nn as nn

torch.manual_seed(0)

# x must satisfy simplex constraint: non-negative, sum to 1 along last dimension
# Shape: (batch_size, num_classes)
x = torch.tensor([
    [0.1, 0.2, 0.3, 0.4],
    [0.25, 0.25, 0.25, 0.25]
], dtype=torch.float32)

# y are class indices for nll_loss
# Shape: (batch_size,)
y = torch.tensor([0, 3], dtype=torch.long)

# weights for scaling the loss
# Shape: (batch_size,)
weights = torch.tensor([1.0, 2.0], dtype=torch.float32)

device = 'cpu'

ARGS = {
    'x': x,
    'y': y,
    'weights': weights,
    'device': device,
    'epsilon': 1e-08
}
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
make_a_group Ran
ran on a synthesized input
z-jianxin/llpfc/llpfclib/make_groups.py
code served (permissive licence) · get_code("4594f9125bd3a7ab")
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 numpy as np
import random
from unittest.mock import Mock

# Set random seed for reproducibility
random.seed(0)
np.random.seed(0)

# Create a simple logger mock
class SimpleLogger:
    def warning(self, msg):
        pass

logger = SimpleLogger()

# Set up parameters for make_a_group
num_classes = 3

# Create a clean prior (probability distribution over classes)
clean_prior = np.array([0.5, 0.3, 0.2])

# Create bag_ids - list of identifiers for bags
bag_ids = list(range(10))

# Create bag2prop - mapping from bag_id to class proportions
# Each bag has a proportion vector of length num_classes
bag2prop = {}
for bag_id in bag_ids:
    # Random proportions that sum to 1
    props = np.random.rand(num_classes)
    props = props / np.sum(props)
    bag2prop[bag_id] = props

# Choose noisy prior method
noisy_prior_choice = 'approx'

ARGS = {
    'num_classes': num_classes,
    'clean_prior': clean_prior,
    'bag_ids': bag_ids,
    'bag2prop': bag2prop,
    'noisy_prior_choice': noisy_prior_choice,
    'logger': logger
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — 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
test_llpgan Ran
ran on a synthesized input
z-jianxin/llpfc/llpganlib/train_fun.py
code served (permissive licence) · get_code("9383576c11fa6d1b")
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 as nn

torch.manual_seed(0)

# Define a small model that matches the usage in test_llpgan
class SmallLLPGAN(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(4, 3)  # 4 input features, 3 output classes
    
    def forward(self, x):
        outputs = self.fc(x)
        # Return outputs and a dummy second value (underscore in function)
        return outputs, torch.tensor([])

# Create model
model = SmallLLPGAN()

# Create a small test loader (list of (images, labels) tuples)
test_loader = [
    (torch.randn(2, 4), torch.randint(0, 3, (2,))),
    (torch.randn(2, 4), torch.randint(0, 3, (2,)))
]

# Create a simple criterion that takes (prob, labels, device)
class SimpleCriterion(nn.Module):
    def __init__(self):
        super().__init__()
    
    def forward(self, prob, labels, device):
        # Compute cross entropy loss
        log_prob = torch.log(prob + 1e-10)
        loss = -log_prob.gather(1, labels.unsqueeze(1)).mean()
        return loss

criterion = SimpleCriterion()

# Set device to CPU
device = torch.device('cpu')

ARGS = {
    'model': model,
    'test_loader': test_loader,
    'criterion': criterion,
    'device': device
}
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
test_model Ran
ran on a synthesized input
z-jianxin/llpfc/llpfclib/train_fun.py
code served (permissive licence) · get_code("735ff4fe221938e9")
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 as nn

torch.manual_seed(0)

# Define a small model
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(4, 3)
    
    def forward(self, x):
        return self.fc(x)

# Create model
model = SimpleModel()

# Create test_loader as list of (images, labels) tuples
# Batch size 2, image dimension 4, 3 classes
test_loader = [
    (torch.randn(2, 4), torch.tensor([0, 1])),
    (torch.randn(2, 4), torch.tensor([2, 0])),
]

# Define a custom criterion that matches the function's usage
class CustomCriterion(nn.Module):
    def forward(self, prob, labels, device):
        # prob is softmax output, labels are targets
        # Return a scalar loss
        return -torch.sum(prob[torch.arange(len(labels)), labels])

criterion = CustomCriterion()

# Device (CPU only)
device = torch.device('cpu')

ARGS = {
    'model': model,
    'test_loader': test_loader,
    'criterion': criterion,
    'device': device,
}
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
truncate_data_group Ran
ran on a synthesized input
z-jianxin/llpfc/llpfclib/utils.py
code served (permissive licence) · get_code("7316381140a2a51d")
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 numpy as np

torch.manual_seed(0)

# Construct x: feature tensor (batch_size=2, features=4)
x = torch.randn(2, 4)

# Construct y: target tensor (batch_size=2)
y = torch.randn(2)

# Construct instance2group: dict mapping instance index to group id
# Use -1 to indicate instances to be filtered out, and valid group ids otherwise
instance2group = {0: 0, 1: -1}

ARGS = {
    "x": x,
    "y": y,
    "instance2group": instance2group,
}
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 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
validate_model_forward Ran
ran on a synthesized input
z-jianxin/llpfc/llpfclib/train_fun.py
code served (permissive licence) · get_code("257860ac14515f2f")
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 float, 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
import torch.nn as nn

torch.manual_seed(0)

# Define a simple model that takes images and outputs logits
class SimpleModel(nn.Module):
    def __init__(self, num_classes=3):
        super().__init__()
        self.fc = nn.Linear(4, num_classes)
    
    def forward(self, x):
        return self.fc(x)

# Define a custom loss function that matches the signature used
def custom_loss_f(prob_corrected, noisy_y, weights, device):
    # Weighted cross-entropy-like loss
    return (prob_corrected.sum() * weights.sum()).mean()

# Create tiny test data
batch_size = 2
num_classes = 3
input_dim = 4

# Create validation loader: list of (images, noisy_y, trans_m, weights)
val_loader = []
for _ in range(2):
    images = torch.randn(batch_size, input_dim)
    noisy_y = torch.randint(0, num_classes, (batch_size,))
    trans_m = torch.eye(num_classes).unsqueeze(0).repeat(batch_size, 1, 1)
    weights = torch.ones(batch_size)
    val_loader.append((images, noisy_y, trans_m, weights))

# Create model and loss function
model = SimpleModel(num_classes=num_classes)
loss_f_val = custom_loss_f
device = "cpu"

ARGS = {
    "model": model,
    "loss_f_val": loss_f_val,
    "val_loader": val_loader,
    "device": device,
}
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 float, 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
validate_model_kl Ran
ran on a synthesized input
z-jianxin/llpfc/kllib/train_fun.py
code served (permissive licence) · get_code("fab18262bd7c9aa6")
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 float, 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
import torch.nn as nn

torch.manual_seed(0)

# Create a simple model that takes images and outputs logits
class SimpleModel(nn.Module):
    def __init__(self, num_classes=5):
        super().__init__()
        self.conv1 = nn.Conv2d(3, 8, kernel_size=3, padding=1)
        self.global_pool = nn.AdaptiveAvgPool2d(1)
        self.fc = nn.Linear(8, num_classes)
    
    def forward(self, x):
        x = self.conv1(x)
        x = self.global_pool(x)
        x = x.view(x.size(0), -1)
        x = self.fc(x)
        return x

# Create model
model = SimpleModel(num_classes=5)

# Create a simple data loader with (images, props) tuples
# images shape: (batch_size=2, bag_size=3, channels=3, height=4, width=4)
# props shape: (batch_size=2, num_classes=5)
batch_size = 2
bag_size = 3
channels = 3
height = 4
width = 4
num_classes = 5

val_loader = []
for _ in range(2):
    images = torch.randn(batch_size, bag_size, channels, height, width)
    props = torch.nn.functional.softmax(torch.randn(batch_size, num_classes), dim=-1)
    val_loader.append((images, props))

# Device is CPU
device = 'cpu'

ARGS = {
    'model': model,
    'val_loader': val_loader,
    'device': device,
}
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 float, 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
approx_noisy_prior Not yet run
unverified (harvested, no recorded run)
z-jianxin/llpfc/llpfclib/make_groups.py
code served (permissive licence) · get_code("1dd7d15d0579ec92")
How it ran

no invocation recorded.

compute_dis_loss Not yet run
unverified (harvested, no recorded run)
z-jianxin/llpfc/llpganlib/train_fun.py
code served (permissive licence) · get_code("aa4ce400bd6bb308")
How it ran

no invocation recorded.

compute_kl_loss_on_bagbatch Not yet run
unverified (harvested, no recorded run)
z-jianxin/llpfc/kllib/train_fun.py
code served (permissive licence) · get_code("32690d2d1696b286")
How it ran

no invocation recorded.

make_bags_counts Not yet run
unverified (harvested, no recorded run)
z-jianxin/llpfc/llpfclib/make_bags.py
code served (permissive licence) · get_code("e4b4fecc775f1957")
How it ran

no invocation recorded.

make_bags_dirichlet Not yet run
unverified (harvested, no recorded run)
z-jianxin/llpfc/llpfclib/make_bags.py
code served (permissive licence) · get_code("46a69e93d1e82f52")
How it ran

no invocation recorded.

make_bags_uniform Not yet run
unverified (harvested, no recorded run)
z-jianxin/llpfc/llpfclib/make_bags.py
code served (permissive licence) · get_code("e8b1a9a1c3eb655f")
How it ran

no invocation recorded.

merge_bags Not yet run
unverified (harvested, no recorded run)
z-jianxin/llpfc/llpfclib/make_groups.py
code served (permissive licence) · get_code("c0dd0d0fc964de0d")
How it ran

no invocation recorded.

Also present in other papers' code

Of 20 samples lifted from this paper's linked repositories, 20 carry a function identity and 0 do not. Of the 20 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 with at least one paper dated earlier, 0 the same month, 1 later) and 19 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
sigmoid_rampup 19 other papers
9 dated earlier, 9 later, 1 same year, order not determinable
1806.04606 (2018-06)
Knowledge Distillation by On-the-Fly Native Ensemble
1904.04717 (2019-04)
Label Propagation for Deep Semi-supervised Learning
1904.09058 (2019-04)
Feature Fusion for Online Mutual Knowledge Distillation
and 16 more not named here

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

Learning from label proportions (LLP) is a weakly supervised classification problem where data points are grouped into bags, and the label proportions within each bag are observed instead of the instance-level labels. The task is to learn a classifier to predict the individual labels of future individual instances. Prior work on LLP for multi-class data has yet to develop a theoretically grounded algorithm. In this work, we provide a theoretically grounded approach to LLP based on a reduction to learning with label noise, using the forward correction (FC) loss of \citet{Patrini2017MakingDN}. We establish an excess risk bound and generalization error analysis for our approach, while also extending the theory of the FC loss which may be of independent interest. Our approach demonstrates improved empirical performance in deep learning scenarios across multiple datasets and architectures, compared to the leading existing methods.

For agents

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

get_harvested_code_for_paper("2203.02496")
get_code_for_paper("2203.02496")
have("2203.02496")

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

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

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

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

Connect an agent — have() is free.