SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2306.09844 · 2023

Wasserstein distributional robustness of neural networks

arXiv · PDF · Open in the Atlas

Code that ran

4 of 8 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 3 have no contract verdict; 0 failures of our instrument; 4 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2306.09844.json · badge: /api/ran/2306.09844.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
janobloj/w-dro-adversarial-methods canonical (classifier label)
classifier basis: census
4 ran · 4 no recorded run
FunctionStatusWhere it lives
dict_translate Ran
ran on a synthesized input
janobloj/w-dro-adversarial-methods/src/utils.py
code served (permissive licence) · get_code("644cf31925f95e57")
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)

# Analyze the function:
# - dict_translate takes two parameters: 'dict' (a dict) and 's' (a string with default '_')
# - It iterates over dict.items() and prepends 's' to each key
# - It returns a new dict with modified keys

# Create a simple test dictionary
test_dict = {
    'key1': 'value1',
    'key2': 42,
    'key3': [1, 2, 3],
    'tensor': torch.randn(2, 4)
}

# Define separator string
separator = '_'

ARGS = {
    'dict': test_dict,
    's': separator
}
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
if_exist Ran
ran on a synthesized input
janobloj/w-dro-adversarial-methods/src/utils.py
code served (permissive licence) · get_code("de4f6c380abb5474")
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 bool, 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 os
import tempfile

# Create a temporary directory for testing
temp_dir = tempfile.mkdtemp()

# Create a subdirectory to use as folder_name
folder_name = temp_dir
exp_name = "test_experiment"

# Create a .pkl file to test the exists case
pkl_file_path = os.path.join(folder_name, f"{exp_name}.pkl")
with open(pkl_file_path, 'w') as f:
    f.write("")

ARGS = {
    "folder_name": folder_name,
    "exp_name": exp_name
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type bool, 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
pil_loader Ran
ran, honoured the contract we drafted
janobloj/w-dro-adversarial-methods/src/imagenet_loader.py
code served (permissive licence) · get_code("f321f54723433661")
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 Image. 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
from PIL import Image
import io
import os
import tempfile

# Create a temporary directory for test files
temp_dir = tempfile.mkdtemp()

# Create a simple RGB image and save it to a temporary file
img = Image.new('RGB', (10, 10), color=(73, 109, 137))
test_image_path = os.path.join(temp_dir, 'test_image.jpg')
img.save(test_image_path)

ARGS = {
    'path': test_image_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
PIL, numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int 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
sizing Ran
ran on a synthesized input
janobloj/w-dro-adversarial-methods/src/utils.py
code served (permissive licence) · get_code("cc73e4fb2da3b7d3")
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 small neural network
class SimpleNetwork(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 2)
    
    def forward(self, x):
        x = self.linear1(x)
        x = self.linear2(x)
        return x

network = SimpleNetwork()

ARGS = {
    'network': network
}
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
accimage_loader Not yet run
unverified (harvested, no recorded run)
janobloj/w-dro-adversarial-methods/src/imagenet_loader.py
pointer only (licence: MIT); the stored copy get_code serves, from RobustBench/robustbench, is pointer only (licence: NOASSERTION) · get_code("404fb2b2daa1ae78")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from RobustBench/robustbench, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

get_cifar100_split Not yet run
unverified (harvested, no recorded run)
janobloj/w-dro-adversarial-methods/src/data.py
code served (permissive licence) · get_code("ca6af5b893212974")
How it ran

no invocation recorded.

get_cifar10_split Not yet run
unverified (harvested, no recorded run)
janobloj/w-dro-adversarial-methods/src/data.py
code served (permissive licence) · get_code("4045004ed37b8e13")
How it ran

no invocation recorded.

make_custom_dataset Not yet run
unverified (harvested, no recorded run)
janobloj/w-dro-adversarial-methods/src/imagenet_loader.py
pointer only (licence: MIT); the stored copy get_code serves, from RobustBench/robustbench, is pointer only (licence: NOASSERTION) · get_code("c4c57c3f5b63ae66")
How it ran

The body of this sample is withheld: this paper's link allows the body inline (MIT), but get_code serves the stored copy, first harvested from RobustBench/robustbench, and GitHub could not classify the licence of that repository (NOASSERTION). 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.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 3 are also present in other papers whose code we hold (2 with at least one paper dated earlier, 0 the same month, 3 later) and 5 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
pil_loader 66 other papers
27 dated earlier, 36 later, 3 same year, order not determinable
1502.03044 (2015-02)
Show, Attend and Tell: Neural Image Caption Generation with Visual Attention
1710.10196 (2017-10)
Progressive Growing of GANs for Improved Quality, Stability, and Variation
1711.02512 (2017-11)
Fine-tuning CNN Image Retrieval with No Human Annotation
and 63 more not named here
accimage_loader 39 other papers
16 dated earlier, 22 later, 1 same year, order not determinable
1702.00758 (2017-02)
HashNet: Deep Learning to Hash by Continuation
1711.02512 (2017-11)
Fine-tuning CNN Image Retrieval with No Human Annotation
1805.00907 (2018-05)
Glow: Graph Lowering Compiler Techniques for Neural Networks
and 36 more not named here
make_custom_dataset 2 other papers
2 later
2403.06668 (2024-03)
PeerAiD: Improving Adversarial Distillation from a Specialized Peer Tutor
2606.21488 (2026-06)
Robustness Cannot be Reduced to Regularization: Studying Adversarial Training Beyond the Linear Case

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 neural networks are known to be vulnerable to adversarial attacks (AA). For an image recognition task, this means that a small perturbation of the original can result in the image being misclassified. Design of such attacks as well as methods of adversarial training against them are subject of intense research. We re-cast the problem using techniques of Wasserstein distributionally robust optimization (DRO) and obtain novel contributions leveraging recent insights from DRO sensitivity analysis. We consider a set of distributional threat models. Unlike the traditional pointwise attacks, which assume a uniform bound on perturbation of each input data point, distributional threat models allow attackers to perturb inputs in a non-uniform way. We link these more general attacks with questions of out-of-sample performance and Knightian uncertainty. To evaluate the distributional robustness of neural networks, we propose a first-order AA algorithm and its multi-step version. Our attack algorithms include Fast Gradient Sign Method (FGSM) and Projected Gradient Descent (PGD) as special cases. Furthermore, we provide a new asymptotic estimate of the adversarial accuracy against distributional threat models. The bound is fast to compute and first-order accurate, offering new insights even for the pointwise AA. It also naturally yields out-of-sample performance guarantees. We conduct numerical experiments on the CIFAR-10 dataset using DNNs on RobustBench to illustrate our theoretical results. Our code is available at https://github.com/JanObloj/W-DRO-Adversarial-Methods.

For agents

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

get_harvested_code_for_paper("2306.09844")
get_code_for_paper("2306.09844")
have("2306.09844")

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

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

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

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

Connect an agent — have() is free.