| forward_feature_mobilenetv3 |
Ran ran on a synthesized input |
gist-ailab/block-selection-for-ood-detection/eval_imagenet.py code served (permissive licence) · get_code("937a1819f5a1570b") How it ranRan 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. 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)
# Build a minimal MobileNetV3-like model with a features attribute
class MinimalMobileNetV3(nn.Module):
def __init__(self):
super().__init__()
self.features = nn.Sequential(
nn.Conv2d(3, 8, kernel_size=3, padding=1),
nn.ReLU(inplace=True),
nn.Conv2d(8, 16, kernel_size=3, padding=1),
nn.ReLU(inplace=True),
nn.Conv2d(16, 32, kernel_size=3, padding=1),
nn.ReLU(inplace=True),
)
def forward(self, x):
return self.features(x)
model = MinimalMobileNetV3()
# Create a small input tensor: batch size 2, 3 channels, 4x4 spatial
x = torch.randn(2, 3, 4, 4)
ARGS = {
"model": model,
"x": x,
}
- 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 — a list 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
|
| forward_feature_resnet50 |
Ran ran on a synthesized input |
gist-ailab/block-selection-for-ood-detection/eval_imagenet.py code served (permissive licence) · get_code("32a3d49226953bdd") How it ranRan 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. 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)
class BasicBlock(nn.Module):
expansion = 1
def __init__(self, in_channels, out_channels, stride=1):
super().__init__()
self.conv1 = nn.Conv2d(in_channels, out_channels, kernel_size=3, stride=stride, padding=1, bias=False)
self.bn1 = nn.BatchNorm2d(out_channels)
self.relu = nn.ReLU(inplace=True)
self.conv2 = nn.Conv2d(out_channels, out_channels, kernel_size=3, stride=1, padding=1, bias=False)
self.bn2 = nn.BatchNorm2d(out_channels)
self.stride = stride
self.downsample = None
if stride != 1 or in_channels != out_channels:
self.downsample = nn.Sequential(
nn.Conv2d(in_channels, out_channels, kernel_size=1, stride=stride, bias=False),
nn.BatchNorm2d(out_channels)
)
def forward(self, x):
identity = x
out = self.conv1(x)
out = self.bn1(out)
out = self.relu(out)
out = self.conv2(out)
out = self.bn2(out)
if self.downsample is not None:
identity = self.downsample(x)
out += identity
out = self.relu(out)
return out
class Bottleneck(nn.Module):
expansion = 4
def __init__(self, in_channels, out_channels, stride=1):
super().__init__()
self.conv1 = nn.Conv2d(in_channels, out_channels, kernel_size=1, bias=False)
self.bn1 = nn.BatchNorm2d(out_channels)
self.conv2 = nn.Conv2d(out_channels, out_channels, kernel_size=3, stride=stride, padding=1, bias=False)
self.bn2 = nn.BatchNorm2d(out_channels)
self.conv3 = nn.Conv2d(out_channels, out_channels * self.expansion, kernel_size=1, bias=False)
self.bn3 = nn.BatchNorm2d(out_channels * self.expansion)
self.relu = nn.ReLU(inplace=True)
self.stride = stride
self.downsample = None
if stride != 1 or in_channels != out_channels * self.expansion:
self.downsample = nn.Sequential(
nn.Conv2d(in_channels, out_channels * self.expansion, kernel_size=1, stride=stride, bias=False),
nn.BatchNorm2d(out_channels * self.expansion)
)
def forward(self, x):
identity = x
out = self.conv1(x)
out = self.bn1(out)
out = self.relu(out)
out = self.conv2(out)
out = self.bn2(out)
out = self.relu(out)
out = self.conv3(out)
out = self.bn3(out)
if self.downsample is not None:
identity = self.downsample(x)
out += identity
out = self.relu(out)
return out
class TinyResNet50(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(3, 8, kernel_size=7, stride=2, padding=3, bias=False)
self.bn1 = nn.BatchNorm2d(8)
self.relu = nn.ReLU(inplace=True)
self.maxpool = nn.MaxPool2d(kernel_size=3, stride=2, padding=1)
self.layer1 = nn.Sequential(
Bottleneck(8, 8, stride=1),
Bottleneck(32, 8, stride=1),
Bottleneck(32, 8, stride=1)
)
self.layer2 = nn.Sequential(
Bottleneck(32, 16, stride=2),
Bottleneck(64, 16, stride=1),
Bottleneck(64, 16, stride=1),
Bottleneck(64, 16, stride=1)
)
self.layer3 = nn.Sequential(
Bottleneck(64, 32, stride=2),
Bottleneck(128, 32, stride=1),
Bottleneck(128, 32, stride=1),
Bottleneck(128, 32, stride=1),
Bottleneck(128, 32, stride=1),
Bottleneck(128, 32, stride=1)
)
self.layer4 = nn.Sequential(
Bottleneck(128, 64, stride=2),
Bottleneck(256, 64, stride=1),
Bottleneck(256, 64, stride=1)
)
model = TinyResNet50()
x = torch.randn(2, 3, 64, 64)
ARGS = {
"model": model,
"x": x
}
- 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 — a list 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
|
| forward_feature_vgg16 |
Ran ran on a synthesized input |
gist-ailab/block-selection-for-ood-detection/eval_imagenet.py code served (permissive licence) · get_code("c8011d4c2ad94d63") How it ranRan 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. 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)
# Build a minimal VGG16-like model that has a features attribute
# The function accesses model.features[i] for indices 0 through 29
class MinimalVGG16(nn.Module):
def __init__(self):
super().__init__()
# Create 30 layers to match the indices accessed in the loop
layers_list = []
# Layer 0-4: first block (64 filters + ReLU + ReLU + MaxPool)
layers_list.append(nn.Conv2d(3, 64, kernel_size=3, padding=1)) # 0
layers_list.append(nn.ReLU(inplace=True)) # 1 - 'r'
layers_list.append(nn.Conv2d(64, 64, kernel_size=3, padding=1)) # 2
layers_list.append(nn.ReLU(inplace=True)) # 3 - 'r'
layers_list.append(nn.MaxPool2d(kernel_size=2, stride=2)) # 4 - 'M'
# Layer 5-9: second block (128 filters)
layers_list.append(nn.Conv2d(64, 128, kernel_size=3, padding=1)) # 5
layers_list.append(nn.ReLU(inplace=True)) # 6 - 'r'
layers_list.append(nn.Conv2d(128, 128, kernel_size=3, padding=1)) # 7
layers_list.append(nn.ReLU(inplace=True)) # 8 - 'r'
layers_list.append(nn.MaxPool2d(kernel_size=2, stride=2)) # 9 - 'M'
# Layer 10-15: third block (256 filters)
layers_list.append(nn.Conv2d(128, 256, kernel_size=3, padding=1)) # 10
layers_list.append(nn.ReLU(inplace=True)) # 11 - 'r'
layers_list.append(nn.Conv2d(256, 256, kernel_size=3, padding=1)) # 12
layers_list.append(nn.ReLU(inplace=True)) # 13 - 'r'
layers_list.append(nn.Conv2d(256, 256, kernel_size=3, padding=1)) # 14
layers_list.append(nn.ReLU(inplace=True)) # 15 - 'r'
layers_list.append(nn.MaxPool2d(kernel_size=2, stride=2)) # 16 - 'M'
# Layer 17-22: fourth block (512 filters)
layers_list.append(nn.Conv2d(256, 512, kernel_size=3, padding=1)) # 17
layers_list.append(nn.ReLU(inplace=True)) # 18 - 'r'
layers_list.append(nn.Conv2d(512, 512, kernel_size=3, padding=1)) # 19
layers_list.append(nn.ReLU(inplace=True)) # 20 - 'r'
layers_list.append(nn.Conv2d(512, 512, kernel_size=3, padding=1)) # 21
layers_list.append(nn.ReLU(inplace=True)) # 22 - 'r'
layers_list.append(nn.MaxPool2d(kernel_size=2, stride=2)) # 23 - 'M'
# Layer 24-29: fifth block (512 filters)
layers_list.append(nn.Conv2d(512, 512, kernel_size=3, padding=1)) # 24
layers_list.append(nn.ReLU(inplace=True)) # 25 - 'r'
layers_list.append(nn.Conv2d(512, 512, kernel_size=3, padding=1)) # 26
layers_list.append(nn.ReLU(inplace=True)) # 27 - 'r'
layers_list.append(nn.Conv2d(512, 512, kernel_size=3, padding=1)) # 28
layers_list.append(nn.ReLU(inplace=True)) # 29 - 'r'
layers_list.append(nn.MaxPool2d(kernel_size=2, stride=2)) # 30 - 'M'
self.features = nn.Sequential(*layers_list)
def forward(self, x):
return self.features(x)
model = MinimalVGG16()
x = torch.randn(2, 3, 32, 32)
ARGS = {
'model': model,
'x': x
}
- 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 — a list 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_cifar_jigsaw |
Ran ran on a synthesized input |
gist-ailab/block-selection-for-ood-detection/utils/dataset.py code served (permissive licence) · get_code("62ee6bf0519a0c4c") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.utils.data as data
from torchvision import transforms
import tempfile
import os
torch.manual_seed(0)
# Create a minimal mock CIFAR10 dataset
class MockCIFAR10(data.Dataset):
def __init__(self, root, train=True, transform=None, download=False):
self.transform = transform
self.data = torch.randn(4, 3, 32, 32)
self.targets = [0, 1, 0, 1]
def __len__(self):
return len(self.targets)
def __getitem__(self, idx):
img = self.data[idx]
if self.transform:
img = self.transform(img)
return img, self.targets[idx]
# Monkey-patch to avoid actual download
import torchvision.datasets as dset
original_cifar10 = dset.CIFAR10
dset.CIFAR10 = MockCIFAR10
# Define ARGS
ARGS = {
'dataset': 'cifar10',
'folder': '/tmp/cifar_data',
'batch_size': 2,
'test': False
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_imagenet_jigsaw |
Ran ran on a synthesized input |
gist-ailab/block-selection-for-ood-detection/utils/dataset.py code served (permissive licence) · get_code("87b16ce2369fe4eb") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned tuple, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
import torch.utils.data as data
from torchvision import transforms
import os
import tempfile
from PIL import Image
import numpy as np
torch.manual_seed(0)
# Create a temporary directory structure mimicking ImageNet
temp_dir = tempfile.mkdtemp()
train_dir = os.path.join(temp_dir, 'train')
os.makedirs(train_dir, exist_ok=True)
# Create dummy class directories and images
for class_id in range(2):
class_dir = os.path.join(train_dir, f'class_{class_id}')
os.makedirs(class_dir, exist_ok=True)
# Create 2 dummy images per class (224x224 RGB)
for img_id in range(2):
img_array = np.random.randint(0, 256, (224, 224, 3), dtype=np.uint8)
img = Image.fromarray(img_array)
img.save(os.path.join(class_dir, f'image_{img_id}.jpg'))
ARGS = {
'imagenet_path': temp_dir,
'batch_size': 2,
'test': False,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| read_conf |
Ran ran on a synthesized input |
gist-ailab/block-selection-for-ood-detection/utils/dataset.py code served (permissive licence) · get_code("9a737c6cbb1f5620") How it ranRan 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 json
import tempfile
import os
# Create a temporary JSON file with valid configuration
temp_dir = tempfile.mkdtemp()
json_path = os.path.join(temp_dir, "config.json")
config_data = {
"model": "test_model",
"learning_rate": 0.001,
"batch_size": 32,
"epochs": 10,
"hidden_dim": 128
}
with open(json_path, 'w') as f:
json.dump(config_data, f)
ARGS = {
"json_path": json_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 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
|
| validation_accuracy |
Ran ran on a synthesized input |
gist-ailab/block-selection-for-ood-detection/utils/metric.py code served (permissive licence) · get_code("9530fc046c804317") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
# Define a simple model
class SimpleClassifier(nn.Module):
def __init__(self, input_dim=4, num_classes=3):
super(SimpleClassifier, self).__init__()
self.linear = nn.Linear(input_dim, num_classes)
def forward(self, x):
return self.linear(x)
# Create model instance
model = SimpleClassifier(input_dim=4, num_classes=3)
# Create a simple data loader (list of (inputs, targets) tuples)
# Batch size 2, input dimension 4, 3 classes
batch1_inputs = torch.randn(2, 4)
batch1_targets = torch.tensor([0, 1])
batch2_inputs = torch.randn(2, 4)
batch2_targets = torch.tensor([2, 0])
loader = [
(batch1_inputs, batch1_targets),
(batch2_inputs, batch2_targets)
]
# Set device to CPU
device = 'cpu'
ARGS = {
'model': model,
'loader': loader,
'device': device
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| validation_accuracy_norm |
Ran ran on a synthesized input |
gist-ailab/block-selection-for-ood-detection/utils/metric.py code served (permissive licence) · get_code("5d06985afd044e26") How it ranRan 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
import torch.nn.functional as F
torch.manual_seed(0)
class SimpleResNet(nn.Module):
def __init__(self):
super().__init__()
self.conv1 = nn.Conv2d(3, 16, kernel_size=3, padding=1)
self.bn1 = nn.BatchNorm2d(16)
self.act1 = nn.ReLU()
self.maxpool = nn.MaxPool2d(kernel_size=2, stride=2)
self.layer1 = nn.Sequential(nn.Conv2d(16, 32, kernel_size=3, padding=1))
self.layer2 = nn.Sequential(nn.Conv2d(32, 64, kernel_size=3, padding=1))
self.layer3 = nn.Sequential(nn.Conv2d(64, 128, kernel_size=3, padding=1))
self.layer4 = nn.Sequential(nn.Conv2d(128, 512, kernel_size=3, padding=1))
self.global_pool = nn.AdaptiveAvgPool2d((1, 1))
self.fc = nn.Linear(512, 10)
def forward(self, x):
return self.fc(x)
model = SimpleResNet()
# Create a simple data loader with 2 batches, each with 2 samples
# Input shape: (2, 3, 8, 8) - batch_size=2, channels=3, height=8, width=8
# Targets: class labels (0-9)
batch1 = (torch.randn(2, 3, 8, 8), torch.randint(0, 10, (2,)))
batch2 = (torch.randn(2, 3, 8, 8), torch.randint(0, 10, (2,)))
loader = [batch1, batch2]
device = 'cpu'
ARGS = {
'model': model,
'loader': loader,
'device': device,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| validation_accuracy_norm_wrn |
Not yet run unverified (harvested, no recorded run) |
gist-ailab/block-selection-for-ood-detection/utils/metric.py code served (permissive licence) · get_code("32c613ba479e2e4b") How it ran |