SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2111.08175 · NeurIPS · 2021

Inverse-Weighted Survival Games

Adler Perotte, Mark Goldstein, Rajesh Ranganath, Xintian Han, Thomas Wies

arXiv · PDF · Open in the Atlas

Code that ran

9 of 10 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, 1 violated it and 2 have no contract verdict; 5 failures of our instrument; 1 no recorded run); 2 of them were also run on the host, not in the jail, by the peer-agreement lane that set their 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/2111.08175.json · badge: /api/ran/2111.08175.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
rajesh-lab/inverse-weighted-survival-games canonical (classifier label)
classifier basis: classifier_2025
9 ran · 1 no recorded run
FunctionStatusWhere it lives
POOL Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
rajesh-lab/inverse-weighted-survival-games/models.py
code served (permissive licence) · get_code("039beafb5677f7b7")
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 Tensor, ndim 4, dtype family float, shape (2, 4, 4, 3) 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-04T22:19:57Z). 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.functional as F

torch.manual_seed(0)

# POOL takes a single parameter x which is passed to F.max_pool2d
# F.max_pool2d expects a 4D tensor (batch, channels, height, width)
# We'll create a small tensor with batch=2, channels=4, height=8, width=6
# to have distinct dimensions for probing

x = torch.randn(2, 4, 8, 6)

ARGS = {
    "x": x
}
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 4, dtype family float, shape (2, 4, 4, 3) — shape (2, 4, 4, 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
POOL1d Ran
ran, violated the contract we drafted
rajesh-lab/inverse-weighted-survival-games/models.py
code served (permissive licence) · get_code("66bf2ed03384e1e9")
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 Tensor, ndim 3, dtype family float, shape (2, 4, 4) 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-05T00:11:38Z). 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

torch.manual_seed(0)

# The function POOL1d takes a single parameter x
# It applies max_pool1d with kernel size 2
# x should be a 3D tensor (batch, channels, length) for 1D pooling

# Create a small 3D tensor: (batch=2, channels=4, length=8)
x = torch.randn(2, 4, 8)

ARGS = {
    "x": x
}
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 3, dtype family float, shape (2, 4, 4) — shape (2, 4, 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
CatDist Ran
ran on a synthesized input
rajesh-lab/inverse-weighted-survival-games/_nll.py
code served (permissive licence) · get_code("1a3a98b596782658")
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 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
from types import SimpleNamespace

def safe_log(x, eps):
    return (x + eps).log()

# Create args object with required attributes
args = SimpleNamespace(
    K=5,
    kminusone=1,
    device='cpu',
    logeps=1e-8
)

# Create logits for batch size 2, K-1 dimensions (since kminusone=1)
bsz = 2
logits = torch.randn(bsz, args.K - 1)

# Setup util namespace with safe_log function
util = SimpleNamespace(safe_log=safe_log)

# Make util available globally for the class
globals()['util'] = util

INIT_ARGS = {
    'logits': logits,
    'args': args,
    'probs': None,
    'k': None
}

# For calling a method - let's use predict_time() as it's simple and doesn't require arguments
METHOD = 'predict_time'
ARGS = {}
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 1, dtype family float — no output shape is stated: observe_signature.py could not observe it (no_inputs)
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)
Meter Ran
ran on a synthesized input
rajesh-lab/inverse-weighted-survival-games/_nll.py
code served (permissive licence) · get_code("dec8f6c8e34fdba3")
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 NoneType. 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

class Meter:

    def __init__(self):
        self.N = 0
        self.total = 0

    def update(self, val, N):
        self.total += val
        self.N += N

    def avg(self):
        return round(self.total / self.N, 4)


INIT_ARGS = {}

ARGS = {
    'val': 42.5,
    'N': 5
}

METHOD = 'update'

if __name__ == '__main__':
    meter = Meter(**INIT_ARGS)
    meter.update(**ARGS)
    result = meter.avg()
    print(f"Average: {result}")
Setup block drafted by
a language model, class construct-then-call prompt, model not recorded
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type NoneType — a NoneType output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a NoneType 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
RELU Ran
ran, honoured the contract we drafted
rajesh-lab/inverse-weighted-survival-games/models.py
code served (permissive licence) · get_code("4783f20743bb9879")
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 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)

# The RELU function takes a single parameter 'x' which should be a tensor
# It calls .relu() on it, so x must be a torch.Tensor
x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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 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
X_to_dist Ran
ran; our contract draft was wrong, not the code
rajesh-lab/inverse-weighted-survival-games/_nll.py
code served (permissive licence) · get_code("58fe8e99cd3e7982")
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 CatDist. 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 simple model that outputs logits
class SimpleModel(nn.Module):
    def __init__(self, input_dim, output_dim):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, x):
        return self.linear(x)

# Create args object with required attributes
class Args:
    def __init__(self):
        self.K = 4
        self.kminusone = 0
        self.device = 'cpu'
        self.logeps = 1e-10

# Create input tensor (batch_size=2, input_dim=3)
X = torch.randn(2, 3)

# Create model (input_dim=3, output_dim=K=4)
model = SimpleModel(input_dim=3, output_dim=4)

# Create args
args = Args()

# k parameter (optional, can be None or a tensor of indices)
k = None

ARGS = {
    'X': X,
    'model': model,
    'args': 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 CatDist — a CatDist output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a CatDist 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
isnan Ran
ran; our contract draft was wrong, not the code
rajesh-lab/inverse-weighted-survival-games/_nll.py
code served (permissive licence) · get_code("8a9ebc7bfedb61ac")
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, 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)

# The function isnan takes a single parameter x and checks if any element is NaN
# x should be a tensor
x = torch.randn(2, 4)

ARGS = {
    "x": x
}
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, 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
nll_batch Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
rajesh-lab/inverse-weighted-survival-games/_nll.py
code served (permissive licence) · get_code("e1988d777c4ecbd3")
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, 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)

# Build a minimal args object
class Args:
    def __init__(self):
        self.K = 5
        self.kminusone = 1
        self.device = 'cpu'
        self.logeps = 1e-8

args = Args()

# Build a minimal model that outputs logits
class SimpleModel(nn.Module):
    def __init__(self, output_dim):
        super().__init__()
        self.linear = nn.Linear(4, output_dim)
    
    def forward(self, X):
        return self.linear(X)

model = SimpleModel(output_dim=args.K - 1)

# Create sample batch data
batch_size = 2
X = torch.randn(batch_size, 4)
U = torch.randint(0, args.K, (batch_size,))
Delta = torch.tensor([True, False])

# Create the distribution
pred_params = model(X)
dist = nn.Module()  # placeholder, will be replaced

# Build CatDist manually for this test
logits = pred_params
bsz = logits.shape[0]
zeros = torch.zeros(bsz, 1)
new_logits = torch.cat([logits, zeros], dim=-1)
probs = nn.Softmax(dim=-1)(new_logits)

class SimpleDist:
    def __init__(self, probs, args):
        self.probs = probs
        self.args = args
        self.K = args.K
    
    def log_pmf(self, k):
        BSZ = k.shape[0]
        pk = self.probs[torch.arange(BSZ), k]
        logpk = torch.log(pk + args.logeps)
        return logpk
    
    def cdf(self, k, _1m=False):
        bin_times = k
        if _1m:
            bin_times = bin_times - 1.0
        BSZ = bin_times.shape[0]
        bin_times_wide = bin_times.unsqueeze(-1)
        probs_batch = self.probs
        indices = torch.arange(self.K).view(1, -1)
        mask2 = (bin_times_wide >= indices).float()
        cdf_k = (probs_batch * mask2).sum(dim=-1)
        if _1m:
            cdf_k = torch.where(bin_times >= 0.0, cdf_k, torch.zeros_like(cdf_k))
        return cdf_k

dist = SimpleDist(probs, args)

# Create tgt tuple
tgt = (U, Delta)

# Set is_g parameter
is_g = False

ARGS = {
    'tgt': tgt,
    'dist': dist,
    'args': args,
    'is_g': is_g
}
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, 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
safe_log Ran
ran; our contract draft was wrong, not the code
rajesh-lab/inverse-weighted-survival-games/_nll.py
code served (permissive licence) · get_code("81be6fa4b449a9c3")
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)

# safe_log takes two parameters:
# - x: a tensor that will have eps added to it and then log() called
# - eps: a small epsilon value for numerical stability

x = torch.tensor([[1.0, 2.0, 3.0, 4.0],
                   [5.0, 6.0, 7.0, 8.0]])
eps = 1e-8

ARGS = {
    "x": x,
    "eps": eps,
}
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
nll Not yet run
unverified (harvested, no recorded run)
rajesh-lab/inverse-weighted-survival-games/_nll.py
code served (permissive licence) · get_code("b03fa74736ee412a")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 1 later) and 7 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
RELU 1 other paper
1 later
2605.15488 (2026-05)
SurvivalPFN: Amortizing Survival Prediction via In-Context Bayesian Inference
isnan
brick of this paper's assembly: helper
1 other paper
1 undated
no dated paper among those named
openreview_0xJt4PqPJv
Explicitly Modeling Censoring Produces Superior Survival Predictors
safe_log
brick of this paper's assembly: helper
1 other paper
1 undated
no dated paper among those named
openreview_0xJt4PqPJv
Explicitly Modeling Censoring Produces Superior Survival Predictors

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

Deep models trained through maximum likelihood have achieved state-of-the-art results for survival analysis. Despite this training scheme, practitioners evaluate models under other criteria, such as binary classification losses at a chosen set of time horizons, e.g. Brier score (BS) and Bernoulli log likelihood (BLL). Models trained with maximum likelihood may have poor BS or BLL since maximum likelihood does not directly optimize these criteria. Directly optimizing criteria like BS requires inverse-weighting by the censoring distribution. However, estimating the censoring model under these metrics requires inverse-weighting by the failure distribution. The objective for each model requires the other, but neither are known. To resolve this dilemma, we introduce Inverse-Weighted Survival Games. In these games, objectives for each model are built from re-weighted estimates featuring the other model, where the latter is held fixed during training. When the loss is proper, we show that the games always have the true failure and censoring distributions as a stationary point. This means models in the game do not leave the correct distributions once reached. We construct one case where this stationary point is unique. We show that these games optimize BS on simulations and then apply these principles on real world cancer and critically-ill patient data.

For agents

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

get_harvested_code_for_paper("2111.08175")
get_code_for_paper("2111.08175")
have("2111.08175")

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

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

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

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

Connect an agent — have() is free.