SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2010.09750 · 2020

Investigating and Simplifying Masking-based Saliency Methods for Model Interpretability

arXiv · PDF · Open in the Atlas

Code that ran

17 of 19 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 15 have no contract verdict; 2 failures of our instrument; 2 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/2010.09750.json · badge: /api/ran/2010.09750.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
zphang/saliency_investigation canonical (classifier label)
classifier basis: census
17 ran · 2 no recorded run
FunctionStatusWhere it lives
binary_gumbel_softmax Ran
ran on a synthesized input
zphang/saliency_investigation/casme/archs.py
code served (permissive licence) · get_code("c75a899b50d166b6")
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)

# Construct arguments for binary_gumbel_softmax
logits = torch.randn(2, 4)  # Small batch of logits
tau = 0.1
hard = False
epsilon = 1e-08

ARGS = {
    "logits": logits,
    "tau": tau,
    "hard": hard,
    "epsilon": epsilon
}
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
default_infill_func Ran
ran on a synthesized input
zphang/saliency_investigation/casme/criterion.py
code served (permissive licence) · get_code("8f29059810883f70")
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 4, dtype family float, shape (2, 4, 4, 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 torch.nn as nn

torch.manual_seed(0)

# Construct small tensors for the infill function
# The function performs: generated_image * mask + x * (1 - mask)
# All three parameters should be tensors of the same shape

batch_size = 2
height = 4
width = 3
channels = 4

# Create x: original image tensor
x = torch.randn(batch_size, channels, height, width)

# Create mask: binary mask tensor (same shape as x)
mask = torch.randint(0, 2, (batch_size, channels, height, width)).float()

# Create generated_image: generated/inpainted image tensor (same shape as x)
generated_image = torch.randn(batch_size, channels, height, width)

ARGS = {
    "x": x,
    "mask": mask,
    "generated_image": generated_image,
}
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 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
get_activation Ran
ran on a synthesized input
zphang/saliency_investigation/casme/ext/dfnet.py
code served (permissive licence) · get_code("ccefd8f533a37c96")
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 ReLU. 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
from torch import nn

torch.manual_seed(0)

# The function takes a single parameter: name (a string)
# It returns an activation function based on the name
# Valid options are: 'relu', 'elu', 'leaky_relu', 'tanh', 'sigmoid', or None for unknown names

ARGS = {
    'name': 'relu'
}
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 ReLU — a ReLU output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ReLU 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
get_mask Ran
ran on a synthesized input
zphang/saliency_investigation/casme/model_basics.py
code served (permissive licence) · get_code("a2f9db8c0650f2df")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 minimal classifier that returns intermediate layers
class MinimalClassifier(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc1 = nn.Linear(4, 8)
        self.fc2 = nn.Linear(8, 5)
    
    def forward(self, x, return_intermediate=False):
        layer1 = self.fc1(x)
        output = self.fc2(layer1)
        if return_intermediate:
            return output, [layer1]
        return output

# Create a minimal masker that accepts layers and returns masks
class MinimalMasker(nn.Module):
    def __init__(self):
        super().__init__()
        self.mask_layer = nn.Linear(8, 4)
    
    def forward(self, layers, use_p=None, class_ids=None, no_sigmoid=False):
        # layers is a list of intermediate tensors
        x = layers[0]  # Use first intermediate layer
        mask = self.mask_layer(x)
        if not no_sigmoid:
            mask = torch.sigmoid(mask)
        return mask

# Build the model dict with both classifier and masker
classifier = MinimalClassifier()
masker = MinimalMasker()
model = {
    'classifier': classifier,
    'masker': masker
}

# Create input tensor (batch size 2, feature dim 4)
input_tensor = torch.randn(2, 4)

# Define all arguments to the function
ARGS = {
    'input_': input_tensor,
    'model': model,
    'use_p': None,
    'class_ids': None,
    'get_output': False,
    'no_sigmoid': False
}
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
get_masked_images Ran
ran on a synthesized input
zphang/saliency_investigation/casme/casme_utils.py
code served (permissive licence) · get_code("544506b6b4e94b6e")
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 5, 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

torch.manual_seed(0)

# Create small test tensors
# images: shape (batch=2, channels=3, height=4, width=4)
images = torch.randn(2, 3, 4, 4)

# binary_mask: same shape as images for element-wise multiplication
binary_mask = torch.randint(0, 2, (2, 3, 4, 4)).float()

# gray_scale: integer parameter controlling behavior
gray_scale = 1

# return_mask: boolean parameter controlling return value
return_mask = True

ARGS = {
    "images": images,
    "binary_mask": binary_mask,
    "gray_scale": gray_scale,
    "return_mask": return_mask,
}
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 5, 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
get_masked_images_v2 Ran
ran on a synthesized input
zphang/saliency_investigation/casme/casme_utils.py
code served (permissive licence) · get_code("b257e814f0b02a0e")
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 3, 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

torch.manual_seed(0)

# Create small batch tensors
batch_x = torch.randn(2, 4)  # batch_size=2, features=4
mask = torch.randint(0, 2, (2, 4)).float()  # binary mask with same shape

ARGS = {
    "batch_x": batch_x,
    "mask": mask,
}
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 3, 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
get_masks_and_check_predictions Ran
ran on a synthesized input
zphang/saliency_investigation/casme/model_basics.py
code served (permissive licence) · get_code("1eef12cb27f7130e")
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. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 numpy as np

torch.manual_seed(0)

class SimpleClassifier(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(48, 10)
        self.layer1 = nn.Linear(48, 32)
        self.layer2 = nn.Linear(32, 16)
    
    def forward(self, x, return_intermediate=False):
        batch_size = x.size(0)
        x_flat = x.view(batch_size, -1)
        layer1_out = self.layer1(x_flat)
        layer2_out = self.layer2(layer1_out)
        output = self.fc(x_flat)
        
        if return_intermediate:
            layers = [layer1_out, layer2_out]
            return output, layers
        return output

class SimpleMasker(nn.Module):
    def __init__(self):
        super().__init__()
        self.fc = nn.Linear(48, 224 * 224)
    
    def forward(self, layers, use_p=None, class_ids=None, no_sigmoid=False):
        batch_size = layers[0].size(0)
        x = torch.cat([layers[0], layers[1]], dim=1)
        mask_flat = self.fc(x)
        mask = mask_flat.view(batch_size, 1, 224, 224)
        
        if not no_sigmoid:
            mask = torch.sigmoid(mask)
        
        return mask

classifier = SimpleClassifier()
masker = SimpleMasker()

model = {
    'classifier': classifier,
    'masker': masker
}

input_tensor = torch.randn(2, 1, 4, 12)
target_tensor = torch.tensor([3, 7], dtype=torch.long)

ARGS = {
    'input_': input_tensor,
    'target': target_tensor,
    'model': model,
    'erode_k': 0,
    'dilate_k': 0,
    'use_p': None,
    'no_sigmoid': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy, 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
get_norm Ran
ran on a synthesized input
zphang/saliency_investigation/casme/ext/dfnet.py
code served (permissive licence) · get_code("22f472dba4017016")
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 BatchNorm2d. 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)

ARGS = {
    'name': 'batch',
    'out_channels': 64
}
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 BatchNorm2d — a BatchNorm2d output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a BatchNorm2d 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
gram_matrix Ran
ran on a synthesized input
zphang/saliency_investigation/casme/ext/pytorch_inpainting_with_partial_conv.py
code served (permissive licence) · get_code("1715f300a6a58899")
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 3, dtype family float, shape (2, 4, 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 a small feature tensor with shape (batch=2, channels=4, height=3, width=5)
# Using distinct sizes: batch=2, ch=4, h=3, w=5 to make dimensions unambiguous
feat = torch.randn(2, 4, 3, 5)

ARGS = {
    'feat': feat
}
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 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
ignore_superclass_signature Ran
ran on a synthesized input
zphang/saliency_investigation/casme/core.py
code served (permissive licence) · get_code("9c25a48e312acd33")
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 function. 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

def ignore_superclass_signature(f):
    return f

# The function simply returns its argument unchanged
# It takes a single parameter 'f' which should be a callable (function)
# We'll create a simple function to pass as the argument

def dummy_function(x):
    """A simple dummy function to pass as argument"""
    return x + 1

ARGS = {
    'f': dummy_function
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
mask_to_stats Ran
ran on a synthesized input
zphang/saliency_investigation/casme/stats.py
code served (permissive licence) · get_code("a29a81ff6ff8a73e")
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 numpy as np

torch.manual_seed(0)

# The function expects a mask tensor
# Looking at the usage:
# - mask.detach() - it's a tensor
# - mask.mean() - standard tensor operation
# - mask.mean(3).mean(2).std() - reduces over dimensions 3 and 2, then computes std
# - mask.view(-1) - flattens to 1D
# - mask[:, :, :, :-1] and mask[:, :, :, 1:] - slicing operations
# So mask should be a 4D tensor (batch, channels, height, width)

# Create a small 4D tensor with shape (2, 3, 4, 5)
# This will have batch=2, channels=3, height=4, width=5
mask = torch.rand(2, 3, 4, 5, requires_grad=False)

ARGS = {
    'mask': mask
}
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 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
random_mask Ran
ran on a synthesized input
zphang/saliency_investigation/casme/ext/pconv_keras.py
code served (permissive licence) · get_code("ab33a7e0d32b0259")
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 (128, 256, 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 numpy as np

ARGS = {
    'height': 128,
    'width': 256,
    'channels': 3,
    'min_multiplier': 1,
    'max_multiplier': 2,
    'number': 20
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
cv2, numpy — 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 (128, 256, 3) — shape (128, 256, 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
replace_prefix Ran
ran on a synthesized input
zphang/saliency_investigation/casme/archs.py
code served (permissive licence) · get_code("afc608bf21aa9f05")
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 str. 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

ARGS = {
    "s": "prefix_test_string",
    "prefix": "prefix_"
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
resize_like Ran
ran on a synthesized input
zphang/saliency_investigation/casme/ext/dfnet.py
code served (permissive licence) · get_code("72d2ca5c8b19b945")
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 4, dtype family float, shape (2, 4, 6, 7) 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.functional as F

torch.manual_seed(0)

# Create input tensor x with shape (batch=2, channels=4, height=3, width=5)
x = torch.randn(2, 4, 3, 5)

# Create target tensor with shape (batch=2, channels=4, height=6, width=7)
# The function uses target.shape[-2:] to get the last 2 dimensions (height, width)
target = torch.randn(2, 4, 6, 7)

# mode parameter for interpolation
mode = 'bilinear'

ARGS = {
    'x': x,
    'target': target,
    'mode': mode
}
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 4, dtype family float, shape (2, 4, 6, 7) — shape (2, 4, 6, 7) 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
resnet50shared Ran
ran on a synthesized input
zphang/saliency_investigation/casme/archs.py
code served (permissive licence) · get_code("f067739c23018f46")
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 ResNet. 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)

ARGS = {
    "pretrained": False,
    "path": None,
}
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 ResNet — a ResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet 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
total_variation_loss Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
zphang/saliency_investigation/casme/ext/pytorch_inpainting_with_partial_conv.py
code served (permissive licence) · get_code("dedfa1b69056bdc7")
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

torch.manual_seed(0)

# The function expects a 4D tensor (batch, channels, height, width)
# It computes total variation loss by comparing adjacent pixels
# Using small but distinct dimensions: batch=2, channels=3, height=4, width=5
image = torch.randn(2, 3, 4, 5)

ARGS = {
    "image": image
}
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
weights_init Ran
ran; our contract draft was wrong, not the code
zphang/saliency_investigation/casme/ext/pytorch_inpainting_with_partial_conv.py
code served (permissive licence) · get_code("b0a0259ffdb9c7d8")
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 function. 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 math

# Set seed for reproducibility
torch.manual_seed(0)

# Create a simple model with Conv and Linear layers to test the initialization
class SimpleModel(nn.Module):
    def __init__(self):
        super(SimpleModel, self).__init__()
        self.conv1 = nn.Conv2d(3, 16, kernel_size=3)
        self.linear1 = nn.Linear(16, 8)
        self.linear2 = nn.Linear(8, 4)
    
    def forward(self, x):
        x = self.conv1(x)
        x = x.view(x.size(0), -1)
        x = self.linear1(x)
        x = self.linear2(x)
        return x

# Define ARGS dict with all parameters for weights_init
ARGS = {
    'init_type': 'gaussian'
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
accuracy Not yet run
unverified (harvested, no recorded run)
zphang/saliency_investigation/casme/train_utils.py
pointer only (licence: BSD-3-Clause); the stored copy get_code serves, from francisanokye/Audio-Signal-Processing, is pointer only (licence: NONE) · get_code("688c38ac8517471a")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (BSD-3-Clause), but get_code serves the stored copy, first harvested from francisanokye/Audio-Signal-Processing, 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. No invocation recorded.

apply_uniform_random_value_mask_func Not yet run
unverified (harvested, no recorded run)
zphang/saliency_investigation/casme/criterion.py
code served (permissive licence) · get_code("ca4396c9e5d986b8")
How it ran

no invocation recorded.

Also present in other papers' code

Of 19 samples lifted from this paper's linked repositories, 19 carry a function identity and 0 do not. Of the 19 distinct functions with an identity, 12 are also present in other papers whose code we hold (12 with at least one paper dated earlier, 1 the same month, 4 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
accuracy 80 other papers
46 dated earlier, 3 the same month, 31 later
1307.0414 (2013-07)
Challenges in Representation Learning: A report on three machine learning contests
1412.6553 (2014-12)
Speeding-up Convolutional Neural Networks Using Fine-tuned CP-Decomposition
1503.02531 (2015-03)
Distilling the Knowledge in a Neural Network
and 77 more not named here
weights_init 8 other papers
4 dated earlier, 4 later
1611.07004 (2016-11)
Image-to-Image Translation with Conditional Adversarial Networks
1712.02478 (2017-12)
Stacked Conditional Generative Adversarial Networks for Jointly Learning Shadow Detection and Shadow Removal
1804.07723 (2018-04)
Image Inpainting for Irregular Holes Using Partial Convolutions
and 5 more not named here
gram_matrix 6 other papers
3 dated earlier, 3 later
1611.07004 (2016-11)
Image-to-Image Translation with Conditional Adversarial Networks
1804.07723 (2018-04)
Image Inpainting for Irregular Holes Using Partial Convolutions
2004.02788 (2020-04)
Self-Supervised Scene De-occlusion
and 3 more not named here
total_variation_loss 5 other papers
3 dated earlier, 2 later
1611.07004 (2016-11)
Image-to-Image Translation with Conditional Adversarial Networks
1804.07723 (2018-04)
Image Inpainting for Irregular Holes Using Partial Convolutions
2004.02788 (2020-04)
Self-Supervised Scene De-occlusion
and 2 more not named here
binary_gumbel_softmax 1 other paper
1 dated earlier
1806.07421 (2018-06)
RISE: Randomized Input Sampling for Explanation of Black-box Models
get_mask 1 other paper
1 dated earlier
1806.07421 (2018-06)
RISE: Randomized Input Sampling for Explanation of Black-box Models
get_masked_images 1 other paper
1 dated earlier
1806.07421 (2018-06)
RISE: Randomized Input Sampling for Explanation of Black-box Models
get_masked_images_v2 1 other paper
1 dated earlier
1806.07421 (2018-06)
RISE: Randomized Input Sampling for Explanation of Black-box Models
get_masks_and_check_predictions 1 other paper
1 dated earlier
1806.07421 (2018-06)
RISE: Randomized Input Sampling for Explanation of Black-box Models
ignore_superclass_signature 1 other paper
1 dated earlier
1806.07421 (2018-06)
RISE: Randomized Input Sampling for Explanation of Black-box Models
replace_prefix 1 other paper
1 dated earlier
1806.07421 (2018-06)
RISE: Randomized Input Sampling for Explanation of Black-box Models
resnet50shared 1 other paper
1 dated earlier
1806.07421 (2018-06)
RISE: Randomized Input Sampling for Explanation of Black-box Models

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

Saliency maps that identify the most informative regions of an image for a classifier are valuable for model interpretability. A common approach to creating saliency maps involves generating input masks that mask out portions of an image to maximally deteriorate classification performance, or mask in an image to preserve classification performance. Many variants of this approach have been proposed in the literature, such as counterfactual generation and optimizing over a Gumbel-Softmax distribution. Using a general formulation of masking-based saliency methods, we conduct an extensive evaluation study of a number of recently proposed variants to understand which elements of these methods meaningfully improve performance. Surprisingly, we find that a well-tuned, relatively simple formulation of a masking-based saliency model outperforms many more complex approaches. We find that the most important ingredients for high quality saliency map generation are (1) using both masked-in and masked-out objectives and (2) training the classifier alongside the masking model. Strikingly, we show that a masking model can be trained with as few as 10 examples per class and still generate saliency maps with only a 0.7-point increase in localization error.

For agents

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

get_harvested_code_for_paper("2010.09750")
get_code_for_paper("2010.09750")
have("2010.09750")

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

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

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

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

Connect an agent — have() is free.