SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2306.02031 · ICLR · 2024

DOS: Diverse Outlier Sampling for Out-of-Distribution Detection

Hao Cheng, Hongxin Wei, Wenyu Jiang, Mingcai Chen, Chongjun Wang

arXiv · PDF · Open in the Atlas

Code that ran

20 of 21 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, 2 violated it and 8 have no contract verdict; 9 failures of our instrument; 1 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-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/2306.02031.json · badge: /api/ran/2306.02031.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
lygjwy/DOS canonical (classifier label)
classifier basis: census
11 ran · 0 no recorded run
lygjwy/dos canonical (classifier label)
classifier basis: classifier_2025
8 ran · 1 no recorded run
copy not recorded community
not in the paper's declared repositories
1 ran · 0 no recorded run
FunctionStatusWhere it lives
cosine_annealing Ran
ran, violated the contract we drafted
lygjwy/dos/train_diverse.py
code served (permissive licence) · get_code("05eda95f9800a1e9")
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 float64, 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-04T22:12:48Z). 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 = {
    "step": 5,
    "total_steps": 100,
    "lr_max": 0.1,
    "lr_min": 0.001,
}
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 float64, 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
clusterAndChooseSamples Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
this paper's copy was not recorded; identical code first harvested from o4lc/greg-ood
pointer only; the stored copy get_code serves, from o4lc/greg-ood, is pointer only (licence: NONE) · get_code("fc9d1f65e44d5413")
How it ran

The body of this sample is withheld: this paper's copy of the code was not recorded (its link names no repository or source path), so no licence was read for it. 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. A run is recorded.

conv3x3 Ran
ran; our contract draft was wrong, not the code
lygjwy/DOS/models/wide_resnet.py
pointer only (licence: MIT); the stored copy get_code serves, from DaikiTanak/manifold_mixup, is pointer only (licence: NONE) · get_code("00e569acd6b45ef0")
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 DaikiTanak/manifold_mixup, 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. A run is recorded.

default_loader Ran
ran on a synthesized input
lygjwy/DOS/datasets/named_dataset_with_meta.py
code served (permissive licence) · get_code("4de09f91637454ff")
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 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 tempfile
import os
from PIL import Image

# Create a temporary RGB image file
temp_dir = tempfile.mkdtemp()
temp_image_path = os.path.join(temp_dir, "test_image.jpg")

# Create a small test image (4x3 RGB)
test_img = Image.new('RGB', (4, 3), color=(255, 0, 0))
test_img.save(temp_image_path)

ARGS = {
    'path': temp_image_path
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL — 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
get_abs_score Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lygjwy/dos/detect.py
code served (permissive licence) · get_code("6a3f8cf6f1129061")
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 list, ndim 1, dtype family float; no output shape is stated. 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 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 minimal classifier that takes data and outputs logits
class MinimalClassifier(nn.Module):
    def __init__(self, input_dim=4, num_classes=3):
        super().__init__()
        self.linear = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        return self.linear(x)

# Create a minimal data loader
# The function expects sample['data'] to be accessible
data_loader = [
    {'data': torch.randn(2, 4)},
    {'data': torch.randn(2, 4)},
]

# Create the classifier
clf = MinimalClassifier(input_dim=4, num_classes=3)

ARGS = {
    'data_loader': data_loader,
    'clf': clf,
}
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 list, ndim 1, dtype family float — a list 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_abs_weight Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lygjwy/dos/scores/utils.py
code served (permissive licence) · get_code("3cdc0f0decb621be")
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

torch.manual_seed(0)

# Build a minimal classifier that satisfies how the function uses it
class MinimalClassifier(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear = nn.Linear(4, 2)  # Input dim 4, output 2 classes
        self.feat_layer = nn.Linear(4, 3)  # Feature extraction layer (dim 3)
    
    def forward(self, x, ret_feat=False):
        feat = self.feat_layer(x)
        logit = self.linear(x)
        if ret_feat:
            return logit, feat
        else:
            return logit

# Build a minimal data loader (list of dicts with 'data' key)
data_loader = [
    {'data': torch.randn(2, 4)},  # Batch of 2 samples, dim 4
    {'data': torch.randn(2, 4)},  # Another batch
]

# Create the classifier
clf = MinimalClassifier()

# Define ARGS
ARGS = {
    'data_loader': data_loader,
    'clf': clf,
    'ret_feat': True,
}
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 — 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_energy_weight Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lygjwy/dos/scores/utils.py
code served (permissive licence) · get_code("080cda42f763c1b8")
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

torch.manual_seed(0)

# Create a minimal classifier that matches the function's usage
class MinimalClassifier(nn.Module):
    def __init__(self, input_dim=4, hidden_dim=8, num_classes=3, feat_dim=5):
        super().__init__()
        self.input_dim = input_dim
        self.feat_dim = feat_dim
        self.num_classes = num_classes
        self.fc1 = nn.Linear(input_dim, hidden_dim)
        self.fc2 = nn.Linear(hidden_dim, num_classes)
        self.feat_layer = nn.Linear(input_dim, feat_dim)
    
    def forward(self, x, ret_feat=False):
        feat = self.feat_layer(x)
        hidden = torch.relu(self.fc1(x))
        logit = self.fc2(hidden)
        if ret_feat:
            return logit, feat
        else:
            return logit

# Create a simple data loader
# Each sample is a dict with 'data' key containing a tensor
data_loader = [
    {'data': torch.randn(2, 4)},
    {'data': torch.randn(2, 4)}
]

# Create classifier
clf = MinimalClassifier(input_dim=4, hidden_dim=8, num_classes=3, feat_dim=5)

# Define ARGS
ARGS = {
    'data_loader': data_loader,
    'clf': clf,
    'ret_feat': True
}
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 — 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_kl_score Ran
ran on a synthesized input
lygjwy/DOS/scores/utils.py
code served (permissive licence) · get_code("6679b57778186c6a")
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 list, ndim 1, dtype family float; no output shape is stated. 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 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)

# Create a simple classifier model
class SimpleClassifier(nn.Module):
    def __init__(self, input_dim=4, num_classes=3):
        super().__init__()
        self.linear = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        return self.linear(x)

# Create a tiny data loader with the expected format
# The function expects sample['data'] to be accessible
data_loader = [
    {'data': torch.randn(2, 4)},
    {'data': torch.randn(2, 4)}
]

# Create classifier instance
clf = SimpleClassifier(input_dim=4, num_classes=3)

ARGS = {
    'data_loader': data_loader,
    'clf': clf
}
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 list, ndim 1, dtype family float — a list 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_logit_score Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lygjwy/dos/detect.py
code served (permissive licence) · get_code("f4d6252717bec207")
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 list, ndim 1, dtype family float; no output shape is stated. 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 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)

# Build a minimal classifier model
class MinimalClassifier(nn.Module):
    def __init__(self, input_dim=4, num_classes=3):
        super().__init__()
        self.linear = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        return self.linear(x)

# Create the classifier
clf = MinimalClassifier(input_dim=4, num_classes=3)

# Create a minimal data loader
# The function expects sample['data'] to be accessible
data_loader = [
    {'data': torch.randn(2, 4)},
    {'data': torch.randn(2, 4)},
]

ARGS = {
    'data_loader': data_loader,
    'clf': clf,
}
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 list, ndim 1, dtype family float — a list 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_msp_score Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lygjwy/dos/detect.py
code served (permissive licence) · get_code("5545fbfd438c5417")
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 list, ndim 1, dtype family float; no output shape is stated. 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 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)

# Create a minimal classifier model
class MinimalClassifier(nn.Module):
    def __init__(self, input_dim=4, num_classes=3):
        super().__init__()
        self.linear = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        return self.linear(x)

# Create a minimal data loader (list of dicts with 'data' key)
clf = MinimalClassifier(input_dim=4, num_classes=3)

# Create sample data: batch_size=2, feature_dim=4
data_loader = [
    {'data': torch.randn(2, 4)},
    {'data': torch.randn(2, 4)},
]

ARGS = {
    'data_loader': data_loader,
    'clf': clf,
}
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 list, ndim 1, dtype family float — a list 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_msp_weight Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lygjwy/dos/scores/utils.py
code served (permissive licence) · get_code("4a886b1bdfc7c5de")
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

torch.manual_seed(0)

class SimpleClassifier(nn.Module):
    def __init__(self, input_dim=4, num_classes=3, feat_dim=8):
        super().__init__()
        self.feat_dim = feat_dim
        self.fc1 = nn.Linear(input_dim, feat_dim)
        self.fc2 = nn.Linear(feat_dim, num_classes)
    
    def forward(self, x, ret_feat=False):
        feat = self.fc1(x)
        logit = self.fc2(feat)
        if ret_feat:
            return logit, feat
        else:
            return logit

clf = SimpleClassifier(input_dim=4, num_classes=3, feat_dim=8)

# Create a simple data loader
# Each sample is a dict with 'data' key containing a tensor
data_loader = [
    {'data': torch.randn(2, 4)},
    {'data': torch.randn(2, 4)},
]

ret_feat = True

ARGS = {
    'data_loader': data_loader,
    'clf': clf,
    'ret_feat': ret_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 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
has_file_allowed_extension Ran
ran, violated the contract we drafted
lygjwy/DOS/datasets/named_dataset_with_meta.py
code served (permissive licence) · get_code("70ee124084db90b2")
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 torch

ARGS = {
    "filename": "document.pdf",
    "extensions": (".pdf", ".txt", ".doc")
}
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 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
is_img_file Ran
ran on a synthesized input
lygjwy/DOS/datasets/named_dataset_with_meta.py
code served (permissive licence) · get_code("6345c661590e2176")
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 and file for testing
temp_dir = tempfile.mkdtemp()
temp_img_path = os.path.join(temp_dir, 'test_image.jpg')

# Create an actual file so os.path.exists() returns True
with open(temp_img_path, 'w') as f:
    f.write('')

ARGS = {
    'file_path': temp_img_path
}
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
norm Ran
ran, honoured the contract we drafted
lygjwy/DOS/models/wide_resnet.py
pointer only (licence: MIT); the stored copy get_code serves, from mattolson93/counterfactual-state-explanations, is pointer only (licence: NONE) · get_code("b7b09d9d9a19672a")
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 mattolson93/counterfactual-state-explanations, 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. A run is recorded.

test Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
lygjwy/dos/train_diverse.py
code served (permissive licence) · get_code("0f638e35e14ffb38")
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 dict. 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

torch.manual_seed(0)

# Build a minimal classifier model
class MinimalClf(nn.Module):
    def __init__(self, input_dim, num_classes):
        super().__init__()
        self.linear = nn.Linear(input_dim, num_classes)
    
    def forward(self, x):
        return self.linear(x)

# Create model
num_classes = 3
input_dim = 4
clf = MinimalClf(input_dim, num_classes)

# Create data loader as a list of dicts with 'data' and 'label' keys
data_loader = [
    {
        'data': torch.randn(2, input_dim),
        'label': torch.randint(0, num_classes, (2,))
    },
    {
        'data': torch.randn(2, input_dim),
        'label': torch.randint(0, num_classes, (2,))
    }
]

ARGS = {
    'data_loader': data_loader,
    'clf': clf,
    'num_classes': num_classes
}
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 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
touch_file_if_missing Ran
ran on a synthesized input
lygjwy/DOS/utils/logger.py
code served (permissive licence) · get_code("814bb18230b9180e")
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 PosixPath. 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.

from pathlib import Path
import tempfile

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

ARGS = {
    "log_dir": temp_dir,
    "log_name": "test_log.txt"
}
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 PosixPath — a PosixPath output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a PosixPath 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
train_abs Ran
ran on a synthesized input
lygjwy/DOS/trainers/utils.py
code served (permissive licence) · get_code("5fef870f31972307")
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. 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 torch.optim as optim

torch.manual_seed(0)

# Create a minimal neural network that matches function usage
class SimpleNet(nn.Module):
    def __init__(self, num_classes):
        super().__init__()
        self.fc = nn.Linear(4, num_classes + 1)  # +1 for OOD class
    
    def forward(self, x):
        return self.fc(x)

# Create minimal dataset class
class SimpleDataset:
    def __init__(self, num_samples, num_classes):
        self.num_samples = num_samples
        self.classes = list(range(num_classes))
    
    def __len__(self):
        return self.num_samples

# Create data loader as list of batches
def create_data_loader(num_batches, batch_size, num_classes, num_features=4):
    loader = []
    for _ in range(num_batches):
        batch_data = torch.randn(batch_size, num_features)
        batch_labels = torch.randint(0, num_classes, (batch_size,))
        loader.append({
            'data': batch_data,
            'label': batch_labels
        })
    return loader

num_classes = 3
num_id_batches = 2
num_ood_batches = 2
batch_size = 2

# Create data loaders with dataset attribute
data_loader_id = create_data_loader(num_id_batches, batch_size, num_classes)
data_loader_id_obj = type('DataLoader', (), {
    '__iter__': lambda self: iter(data_loader_id),
    '__len__': lambda self: len(data_loader_id),
    'dataset': SimpleDataset(num_id_batches * batch_size, num_classes)
})()

data_loader_ood = create_data_loader(num_ood_batches, batch_size, num_classes)
data_loader_ood_obj = type('DataLoader', (), {
    '__iter__': lambda self: iter(data_loader_ood),
    '__len__': lambda self: len(data_loader_ood),
    'dataset': SimpleDataset(num_ood_batches * batch_size, num_classes)
})()

# Create network
net = SimpleNet(num_classes)

# Create optimizers
optimizer = optim.SGD(net.fc.parameters(), lr=0.01)
linear_optimizer = optim.SGD(net.fc.parameters(), lr=0.01)

# Create schedulers
scheduler = optim.lr_scheduler.StepLR(optimizer, step_size=1)
linear_scheduler = optim.lr_scheduler.StepLR(linear_optimizer, step_size=1)

ARGS = {
    'data_loader_id': data_loader_id_obj,
    'data_loader_ood': data_loader_ood_obj,
    'net': net,
    'optimizer': optimizer,
    'linear_optimizer': linear_optimizer,
    'scheduler': scheduler,
    'linear_scheduler': linear_scheduler,
    'beta': 1.0
}
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 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
train_energy Ran
ran on a synthesized input
lygjwy/DOS/trainers/utils.py
code served (permissive licence) · get_code("aee74338d16b3a23")
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. 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 torch.optim as optim

torch.manual_seed(0)

# Define a simple neural network for classification
class SimpleNet(nn.Module):
    def __init__(self, input_dim=4, num_classes=3):
        super(SimpleNet, self).__init__()
        self.fc1 = nn.Linear(input_dim, 8)
        self.fc2 = nn.Linear(8, num_classes)
    
    def forward(self, x):
        x = torch.relu(self.fc1(x))
        x = self.fc2(x)
        return x

# Create network
net = SimpleNet(input_dim=4, num_classes=3)

# Create optimizer for network parameters
optimizer = optim.SGD(net.parameters(), lr=0.01)

# Create linear optimizer (for linear layer only)
linear_optimizer = optim.SGD(net.fc2.parameters(), lr=0.01)

# Create schedulers
scheduler = optim.lr_scheduler.StepLR(optimizer, step_size=1, gamma=0.9)
linear_scheduler = optim.lr_scheduler.StepLR(linear_optimizer, step_size=1, gamma=0.9)

# Create data loaders - each sample is a dict with 'data' and 'label' keys
def create_data_loader(batch_size=2, num_batches=3, num_classes=3):
    loader = []
    for _ in range(num_batches):
        sample = {
            'data': torch.randn(batch_size, 4),
            'label': torch.randint(0, num_classes, (batch_size,))
        }
        loader.append(sample)
    return loader

data_loader_id = create_data_loader(batch_size=2, num_batches=3, num_classes=3)
data_loader_ood = create_data_loader(batch_size=2, num_batches=3, num_classes=3)

ARGS = {
    'data_loader_id': data_loader_id,
    'data_loader_ood': data_loader_ood,
    'net': net,
    'optimizer': optimizer,
    'linear_optimizer': linear_optimizer,
    'scheduler': scheduler,
    'linear_scheduler': linear_scheduler,
    'beta': 0.1
}
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 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
train_uni Ran
ran on a synthesized input
lygjwy/DOS/trainers/utils.py
code served (permissive licence) · get_code("9028f67f495e27a1")
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. 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 torch.optim as optim

torch.manual_seed(0)

# Build a minimal neural network that takes input and outputs logits
class SimpleNet(nn.Module):
    def __init__(self, input_dim, num_classes):
        super().__init__()
        self.fc1 = nn.Linear(input_dim, 8)
        self.fc2 = nn.Linear(8, num_classes)
    
    def forward(self, x):
        x = torch.relu(self.fc1(x))
        x = self.fc2(x)
        return x

# Create a small network
net = SimpleNet(input_dim=4, num_classes=3)

# Create data loaders as lists of dicts with 'data' and 'label' keys
# ID data loader
data_loader_id = [
    {
        'data': torch.randn(2, 4),  # batch_size=2, input_dim=4
        'label': torch.tensor([0, 1])
    },
    {
        'data': torch.randn(2, 4),
        'label': torch.tensor([2, 0])
    }
]

# OOD data loader (same structure, different data)
data_loader_ood = [
    {
        'data': torch.randn(2, 4),
        'label': torch.tensor([0, 0])  # not used in function
    },
    {
        'data': torch.randn(2, 4),
        'label': torch.tensor([0, 0])
    }
]

# Create optimizers
optimizer = optim.SGD(net.parameters(), lr=0.01)
linear_optimizer = optim.SGD(net.fc2.parameters(), lr=0.01)

# Create schedulers
scheduler = optim.lr_scheduler.StepLR(optimizer, step_size=1, gamma=0.9)
linear_scheduler = optim.lr_scheduler.StepLR(linear_optimizer, step_size=1, gamma=0.9)

ARGS = {
    'data_loader_id': data_loader_id,
    'data_loader_ood': data_loader_ood,
    'net': net,
    'optimizer': optimizer,
    'linear_optimizer': linear_optimizer,
    'scheduler': scheduler,
    'linear_scheduler': linear_scheduler,
    'beta': 0.5
}
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 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
unpickle Ran
ran on a synthesized input
lygjwy/DOS/datasets/imagenet_64.py
code served (permissive licence) · get_code("937d4f7234113d01")
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 pickle
import tempfile
import os

# Create a temporary file with pickled data
temp_dir = tempfile.mkdtemp()
test_data_file = os.path.join(temp_dir, "test_data.pkl")

# Create some sample data to pickle
sample_dict = {
    "key1": "value1",
    "key2": [1, 2, 3],
    "key3": {"nested": "data"}
}

# Write the sample data to the temporary pickle file
with open(test_data_file, 'wb') as f:
    pickle.dump(sample_dict, f)

# Define ARGS mapping all parameters of unpickle function
ARGS = {
    "data_file": test_data_file
}
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 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
get_weight Not yet run
unverified (harvested, no recorded run)
lygjwy/dos/scores/utils.py
code served (permissive licence) · get_code("b5c11ebfae3c544e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 21 samples lifted from this paper's linked repositories, 21 carry a function identity and 0 do not. Of the 21 distinct functions with an identity, 5 are also present in other papers whose code we hold (4 with at least one paper dated earlier, 0 the same month, 4 later) and 16 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
conv3x3 74 other papers
43 dated earlier, 31 later · 5 only as an assembly brick
1605.07146 (2016-05)
Wide Residual Networks
1707.01629 (2017-07)
Dual Path Networks
1802.05668 (2018-02)
Model compression via distillation and quantization
and 71 more not named here
cosine_annealing 9 other papers
5 dated earlier, 3 later, 1 same year, order not determinable
1901.09960 (2019-01)
Using Pre-Training Can Improve Model Robustness and Uncertainty
2003.09711 (2020-03)
Robust Out-of-distribution Detection for Neural Networks
2108.11941 (2021-08)
Semantically Coherent Out-of-Distribution Detection
and 6 more not named here
has_file_allowed_extension 4 other papers
3 dated earlier, 1 later
1905.11946 (2019-05)
EfficientNet: Rethinking Model Scaling for Convolutional Neural Networks
2003.14297 (2020-03)
Generative Latent Implicit Conditional Optimization when Learning from Small Sample
2105.04580 (2021-05)
Towards Discovery and Attribution of Open-world GAN Generated Images
and 1 more not named here
norm 2 other papers
1 dated earlier, 1 same year, order not determinable
2101.12446 (2021-01)
Counterfactual State Explanations for Reinforcement Learning Agents via Generative Deep Learning
aaai_26741 (2023 (year only))
READ: Aggregating Reconstruction Error into Out-of-Distribution Detection
clusterAndChooseSamples
brick of this paper's assembly: entry
1 other paper
1 later
2404.12368 (2024-04)
Gradient-Regularized Out-of-Distribution Detection

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

Modern neural networks are known to give overconfident predictions for out-ofdistribution inputs when deployed in the open world. It is common practice to leverage a surrogate outlier dataset to regularize the model during training, and recent studies emphasize the role of uncertainty in designing the sampling strategy for outlier datasets. However, the OOD samples selected solely based on predictive uncertainty can be biased towards certain types, which may fail to capture the full outlier distribution. In this work, we empirically show that diversity is critical in sampling outliers for OOD detection performance. Motivated by the observation, we propose a straightforward and novel sampling strategy named DOS (Diverse Outlier Sampling) to select diverse and informative outliers. Specifically, we cluster the normalized features at each iteration, and the most informative outlier from each cluster is selected for model training with absent category loss. With DOS, the sampled outliers efficiently shape a globally compact decision boundary between ID and OOD data. Extensive experiments demonstrate the superiority of DOS, reducing the average FPR95 by up to 25.79% on CIFAR-100 with TI-300K.

For agents

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

get_harvested_code_for_paper("2306.02031")
get_code_for_paper("2306.02031")
have("2306.02031")

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

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

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

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

Connect an agent — have() is free.