| ConvTBNRelu |
Ran ran on a synthesized input |
hurunyi/Robust-Wide/model.py code served (permissive licence) · get_code("210bfe7e3edfaf78") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 16, 16) 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
from torch import nn
class ConvTBNRelu(nn.Module):
def __init__(self, channels_in, channels_out, stride=2):
super(ConvTBNRelu, self).__init__()
self.layers = nn.Sequential(nn.ConvTranspose2d(channels_in, channels_out, kernel_size=2, stride=stride, padding=0), nn.BatchNorm2d(channels_out), nn.ReLU(inplace=True))
def forward(self, x):
return self.layers(x)
INIT_ARGS = {
'channels_in': 3,
'channels_out': 4,
'stride': 2,
}
ARGS = {
'x': torch.randn(2, 3, 8, 8),
}
model = ConvTBNRelu(**INIT_ARGS)
output = model(**ARGS)
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 4, dtype family float, shape (2, 4, 16, 16) — shape (2, 4, 16, 16) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| DecoderResnet |
Ran ran on a synthesized input |
hurunyi/Robust-Wide/model.py code served (permissive licence) · get_code("22ca713c2d2b31e2") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float, shape (2, 16) 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
import numpy as np
# Define the classes from the provided code
def GroupNorm32(channels):
return nn.GroupNorm(32, channels)
class Interpolate(nn.Module):
def __init__(self, size=None, scale_factor=None):
super(Interpolate, self).__init__()
self.function = F.interpolate
self.size = size
self.scale_factor = scale_factor
def forward(self, x):
return self.function(x, size=self.size, scale_factor=self.scale_factor)
class ResidualBlock(nn.Module):
def __init__(self, in_channel, channel_num, dilation=1, group=1, norm_type='batch'):
super(ResidualBlock, self).__init__()
if norm_type == 'batch':
normalization = nn.BatchNorm2d
elif norm_type == 'instance':
normalization = nn.InstanceNorm2d
elif norm_type == 'group':
normalization = GroupNorm32
else:
raise NotImplementedError
self.conv1 = nn.Conv2d(in_channel, channel_num, 3, 1, padding=dilation, dilation=dilation, groups=group, bias=False)
self.norm1 = normalization(channel_num)
self.conv2 = nn.Conv2d(channel_num, channel_num, 3, 1, padding=dilation, dilation=dilation, groups=group, bias=False)
self.norm2 = normalization(channel_num)
def forward(self, x):
y = F.relu(self.norm1(self.conv1(x)))
y = self.norm2(self.conv2(y))
return F.relu(x + y)
class DecoderResnet(nn.Module):
def __init__(self, image_size=64, message_length=16, in_channels=3, norm_type='batch'):
super(DecoderResnet, self).__init__()
stride_blocks = int(np.log2(image_size // int(np.sqrt(message_length))))
interpolate_scale = 1
max_blocks_num = 6
if stride_blocks > max_blocks_num:
interpolate_scale = 2 ** (max_blocks_num - stride_blocks)
stride_blocks = max_blocks_num
if norm_type == 'batch':
normalization = nn.BatchNorm2d
elif norm_type == 'instance':
normalization = nn.InstanceNorm2d
elif norm_type == 'group':
normalization = GroupNorm32
else:
raise NotImplementedError
self.first_layers = nn.Sequential(nn.Conv2d(in_channels, 128, 3, 1, 1, bias=False), normalization(128), nn.ReLU(inplace=True))
self.down_layers = nn.ModuleList([nn.Sequential(nn.Conv2d(128 * 2 ** i, 128 * 2 ** (i + 1), 3, 2, 1, bias=False), normalization(128 * 2 ** (i + 1)), nn.ReLU(inplace=True)) for i in range(stride_blocks)])
self.down_layers.append(nn.Sequential(nn.Conv2d(128 * 2 ** stride_blocks, 128, 3, 1, 1, bias=False), normalization(128), nn.ReLU(inplace=True)))
if interpolate_scale != 1:
self.down_layers.append(Interpolate(scale_factor=interpolate_scale))
self.keep_layers = nn.Sequential(ResidualBlock(128, 128, dilation=2, norm_type=norm_type), ResidualBlock(128, 128, dilation=2, norm_type=norm_type), ResidualBlock(128, 128, dilation=2, norm_type=norm_type), ResidualBlock(128, 128, dilation=2, norm_type=norm_type), ResidualBlock(128, 128, dilation=4, norm_type=norm_type), ResidualBlock(128, 128, dilation=4, norm_type=norm_type), ResidualBlock(128, 128, dilation=4, norm_type=norm_type), ResidualBlock(128, 128, dilation=4, norm_type=norm_type), ResidualBlock(128, 128, dilation=1, norm_type=norm_type))
self.final_layers = nn.Sequential(nn.Conv2d(128, 1, 3, 1, 1, bias=False), normalization(1) if norm_type != 'group' else nn.GroupNorm(1, 1), nn.ReLU(inplace=True))
def forward(self, x):
y = self.first_layers(x)
for down_layer in self.down_layers:
y = down_layer(y)
y = self.keep_layers(y)
y = self.final_layers(y)
y = y.view(y.shape[0], -1)
return y
INIT_ARGS = {
'image_size': 64,
'message_length': 16,
'in_channels': 3,
'norm_type': 'batch'
}
ARGS = {
'x': torch.randn(2, 3, 64, 64)
}
if __name__ == '__main__':
model = DecoderResnet(**INIT_ARGS)
output = model(**ARGS)
print(f"Output shape: {output.shape}")
print(f"Output: {output}")
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 2, dtype family float, shape (2, 16) — shape (2, 16) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| DoubleConv |
Ran ran on a synthesized input |
hurunyi/Robust-Wide/model.py code served (permissive licence) · get_code("3bc37018ec7a5a7e") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 16, 16) 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
from torch import nn
def GroupNorm32(channels):
return nn.GroupNorm(32, channels)
class DoubleConv(nn.Module):
def __init__(self, in_channels, out_channels, mid_channels=None, norm_type='batch'):
super().__init__()
if not mid_channels:
mid_channels = out_channels
if norm_type == 'batch':
normalization = nn.BatchNorm2d
elif norm_type == 'instance':
normalization = nn.InstanceNorm2d
elif norm_type == 'group':
normalization = GroupNorm32
else:
raise NotImplementedError
self.double_conv = nn.Sequential(nn.Conv2d(in_channels, mid_channels, kernel_size=3, padding=1, bias=False), normalization(mid_channels), nn.ReLU(inplace=True), nn.Conv2d(mid_channels, out_channels, kernel_size=3, padding=1, bias=False), normalization(out_channels), nn.ReLU(inplace=True))
def forward(self, x):
return self.double_conv(x)
INIT_ARGS = {
'in_channels': 3,
'out_channels': 4,
'mid_channels': 8,
'norm_type': 'batch'
}
ARGS = {
'x': torch.randn(2, 3, 16, 16)
}
model = DoubleConv(**INIT_ARGS)
output = model(**ARGS)
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 4, dtype family float, shape (2, 4, 16, 16) — shape (2, 4, 16, 16) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| Down |
Ran ran on a synthesized input |
hurunyi/Robust-Wide/model.py code served (permissive licence) · get_code("9eca04b186a73e7b") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 8, 8, 10) 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
from torch import nn
class GroupNorm32(nn.Module):
def __init__(self, channels):
super().__init__()
self.norm = nn.GroupNorm(32, channels)
def forward(self, x):
return self.norm(x)
class DoubleConv(nn.Module):
def __init__(self, in_channels, out_channels, mid_channels=None, norm_type='batch'):
super().__init__()
if not mid_channels:
mid_channels = out_channels
if norm_type == 'batch':
normalization = nn.BatchNorm2d
elif norm_type == 'instance':
normalization = nn.InstanceNorm2d
elif norm_type == 'group':
normalization = GroupNorm32
else:
raise NotImplementedError
self.double_conv = nn.Sequential(nn.Conv2d(in_channels, mid_channels, kernel_size=3, padding=1, bias=False), normalization(mid_channels), nn.ReLU(inplace=True), nn.Conv2d(mid_channels, out_channels, kernel_size=3, padding=1, bias=False), normalization(out_channels), nn.ReLU(inplace=True))
def forward(self, x):
return self.double_conv(x)
class Down(nn.Module):
def __init__(self, in_channels, out_channels, norm_type='batch'):
super().__init__()
self.maxpool_conv = nn.Sequential(nn.MaxPool2d(2), DoubleConv(in_channels, out_channels, norm_type=norm_type))
def forward(self, x):
return self.maxpool_conv(x)
INIT_ARGS = {
'in_channels': 3,
'out_channels': 8,
'norm_type': 'batch'
}
ARGS = {
'x': torch.randn(2, 3, 16, 20)
}
if __name__ == '__main__':
model = Down(**INIT_ARGS)
output = model(**ARGS)
print(f"Output shape: {output.shape}")
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 4, dtype family float, shape (2, 8, 8, 10) — shape (2, 8, 8, 10) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| ExpandNet |
Ran ran on a synthesized input |
hurunyi/Robust-Wide/model.py code served (permissive licence) · get_code("0c1e41d36661e780") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 32, 32) 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
from torch import nn
class ConvTBNRelu(nn.Module):
def __init__(self, channels_in, channels_out, stride=2):
super(ConvTBNRelu, self).__init__()
self.layers = nn.Sequential(nn.ConvTranspose2d(channels_in, channels_out, kernel_size=2, stride=stride, padding=0), nn.BatchNorm2d(channels_out), nn.ReLU(inplace=True))
def forward(self, x):
return self.layers(x)
class ExpandNet(nn.Module):
def __init__(self, in_channels, out_channels, blocks):
super(ExpandNet, self).__init__()
layers = [ConvTBNRelu(in_channels, out_channels)] if blocks != 0 else []
for _ in range(blocks - 1):
layer = ConvTBNRelu(out_channels, out_channels)
layers.append(layer)
self.layers = nn.Sequential(*layers)
def forward(self, x):
return self.layers(x)
INIT_ARGS = {
'in_channels': 3,
'out_channels': 4,
'blocks': 2
}
ARGS = {
'x': torch.randn(2, 3, 8, 8)
}
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 4, dtype family float, shape (2, 4, 32, 32) — shape (2, 4, 32, 32) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| GroupNorm32 |
Ran ran; our contract draft was wrong, not the code |
hurunyi/Robust-Wide/model.py code served (permissive licence) · get_code("90ffc7b3f94bda72") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) and returned GroupNorm. 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)
# GroupNorm32 takes one parameter: channels
# It returns nn.GroupNorm(32, channels)
# We need to provide a valid number of channels
# GroupNorm requires: num_groups divides num_channels
# Here num_groups=32, so channels must be divisible by 32
# Let's use 64 channels (divisible by 32)
ARGS = {
"channels": 64
}
- 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 GroupNorm — a GroupNorm output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a GroupNorm 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
|
| Interpolate |
Ran ran on a synthesized input |
hurunyi/Robust-Wide/model.py code served (permissive licence) · get_code("2d6fcc19b89b20d5") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 3, 8, 8) 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
from torch import nn
import torch.nn.functional as F
class Interpolate(nn.Module):
def __init__(self, size=None, scale_factor=None):
super(Interpolate, self).__init__()
self.function = F.interpolate
self.size = size
self.scale_factor = scale_factor
def forward(self, x):
return self.function(x, size=self.size, scale_factor=self.scale_factor)
INIT_ARGS = {
'size': (8, 8),
'scale_factor': None
}
ARGS = {
'x': torch.randn(2, 3, 4, 4)
}
if __name__ == '__main__':
model = Interpolate(**INIT_ARGS)
output = model(**ARGS)
print(f"Input shape: {ARGS['x'].shape}")
print(f"Output shape: {output.shape}")
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 4, dtype family float, shape (2, 3, 8, 8) — shape (2, 3, 8, 8) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| ResidualBlock |
Ran ran on a synthesized input |
hurunyi/Robust-Wide/model.py code served (permissive licence) · get_code("fb889d8e2f339b39") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 4, 8, 8) 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
from torch import nn
import torch.nn.functional as F
def GroupNorm32(channels):
return nn.GroupNorm(32, channels)
class ResidualBlock(nn.Module):
def __init__(self, in_channel, channel_num, dilation=1, group=1, norm_type='batch'):
super(ResidualBlock, self).__init__()
if norm_type == 'batch':
normalization = nn.BatchNorm2d
elif norm_type == 'instance':
normalization = nn.InstanceNorm2d
elif norm_type == 'group':
normalization = GroupNorm32
else:
raise NotImplementedError
self.conv1 = nn.Conv2d(in_channel, channel_num, 3, 1, padding=dilation, dilation=dilation, groups=group, bias=False)
self.norm1 = normalization(channel_num)
self.conv2 = nn.Conv2d(channel_num, channel_num, 3, 1, padding=dilation, dilation=dilation, groups=group, bias=False)
self.norm2 = normalization(channel_num)
def forward(self, x):
y = F.relu(self.norm1(self.conv1(x)))
y = self.norm2(self.conv2(y))
return F.relu(x + y)
INIT_ARGS = {
'in_channel': 4,
'channel_num': 4,
'dilation': 1,
'group': 1,
'norm_type': 'batch'
}
ARGS = {
'x': torch.randn(2, 4, 8, 8)
}
if __name__ == '__main__':
block = ResidualBlock(**INIT_ARGS)
output = block(**ARGS)
print(f"Output shape: {output.shape}")
print(f"Expected shape: {ARGS['x'].shape}")
assert output.shape == ARGS['x'].shape, "Output shape mismatch"
print("Success!")
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 4, dtype family float, shape (2, 4, 8, 8) — shape (2, 4, 8, 8) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| UNet |
Ran ran on a synthesized input |
hurunyi/Robust-Wide/model.py code served (permissive licence) · get_code("09d83aed81bca74e") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 4, dtype family float, shape (2, 3, 64, 64) 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
def GroupNorm32(channels):
return nn.GroupNorm(32, channels)
class DoubleConv(nn.Module):
def __init__(self, in_channels, out_channels, mid_channels=None, norm_type='batch'):
super().__init__()
if not mid_channels:
mid_channels = out_channels
if norm_type == 'batch':
normalization = nn.BatchNorm2d
elif norm_type == 'instance':
normalization = nn.InstanceNorm2d
elif norm_type == 'group':
normalization = GroupNorm32
else:
raise NotImplementedError
self.double_conv = nn.Sequential(
nn.Conv2d(in_channels, mid_channels, kernel_size=3, padding=1, bias=False),
normalization(mid_channels),
nn.ReLU(inplace=True),
nn.Conv2d(mid_channels, out_channels, kernel_size=3, padding=1, bias=False),
normalization(out_channels),
nn.ReLU(inplace=True)
)
def forward(self, x):
return self.double_conv(x)
class Down(nn.Module):
def __init__(self, in_channels, out_channels, norm_type='batch'):
super().__init__()
self.maxpool_conv = nn.Sequential(
nn.MaxPool2d(2),
DoubleConv(in_channels, out_channels, norm_type=norm_type)
)
def forward(self, x):
return self.maxpool_conv(x)
class OutConv(nn.Module):
def __init__(self, in_channels, out_channels):
super(OutConv, self).__init__()
self.conv = nn.Conv2d(in_channels, out_channels, kernel_size=1)
def forward(self, x):
return self.conv(x)
class Up(nn.Module):
def __init__(self, in_channels, out_channels, bilinear=True, norm_type='batch'):
super().__init__()
if bilinear:
self.up = nn.Upsample(scale_factor=2, mode='bilinear', align_corners=True)
self.conv = DoubleConv(in_channels, out_channels, in_channels // 2, norm_type=norm_type)
else:
self.up = nn.ConvTranspose2d(in_channels, in_channels // 2, kernel_size=2, stride=2)
self.conv = DoubleConv(in_channels, out_channels, norm_type=norm_type)
def forward(self, x1, x2):
x1 = self.up(x1)
diffY = x2.size()[2] - x1.size()[2]
diffX = x2.size()[3] - x1.size()[3]
x1 = F.pad(x1, [diffX // 2, diffX - diffX // 2, diffY // 2, diffY - diffY // 2])
x = torch.cat([x2, x1], dim=1)
return self.conv(x)
class UNet(nn.Module):
def __init__(self, n_channels=4, n_classes=3, bilinear=False, norm_type='batch'):
super().__init__()
self.n_channels = n_channels
self.n_classes = n_classes
self.bilinear = bilinear
self.inc = DoubleConv(n_channels, 64, norm_type=norm_type)
self.down1 = Down(64, 128, norm_type=norm_type)
self.down2 = Down(128, 256, norm_type=norm_type)
self.down3 = Down(256, 512, norm_type=norm_type)
factor = 2 if bilinear else 1
self.down4 = Down(512, 1024 // factor, norm_type=norm_type)
self.up1 = Up(1024, 512 // factor, bilinear, norm_type=norm_type)
self.up2 = Up(512, 256 // factor, bilinear, norm_type=norm_type)
self.up3 = Up(256, 128 // factor, bilinear, norm_type=norm_type)
self.up4 = Up(128, 64, bilinear, norm_type=norm_type)
self.outc = OutConv(64, n_classes)
def forward(self, x):
x1 = self.inc(x)
x2 = self.down1(x1)
x3 = self.down2(x2)
x4 = self.down3(x3)
x5 = self.down4(x4)
x = self.up1(x5, x4)
x = self.up2(x, x3)
x = self.up3(x, x2)
x = self.up4(x, x1)
x = self.outc(x)
return x
INIT_ARGS = {
'n_channels': 4,
'n_classes': 3,
'bilinear': False,
'norm_type': 'batch'
}
ARGS = {
'x': torch.randn(2, 4, 64, 64)
}
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 4, dtype family float, shape (2, 3, 64, 64) — shape (2, 3, 64, 64) 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| convert_to_np |
Ran ran; our contract draft was wrong, not the code |
hurunyi/robust-wide/dataset.py code served (permissive licence) · get_code("694ad5c8799b9dea") 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 ndarray, ndim 3, dtype family int, shape (3, 32, 32) 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
from PIL import Image
# Create a small PIL Image object
img_array = np.random.randint(0, 256, (64, 64, 3), dtype=np.uint8)
image = Image.fromarray(img_array, mode='RGB')
# Define arguments
ARGS = {
'image': image,
'resolution': 32
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- PIL, 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 (3, 32, 32) — shape (3, 32, 32) 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
|
| decoded_message_error_rate |
Ran ran; our contract draft was wrong, not the code |
hurunyi/robust-wide/utils.py code served (permissive licence) · get_code("4c738e5fa93f3953") 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
torch.manual_seed(0)
# Create two tensors with float values between 0 and 1
# These will be compared after thresholding at 0.5
message = torch.tensor([0.1, 0.6, 0.3, 0.9], dtype=torch.float32)
decoded_message = torch.tensor([0.2, 0.55, 0.4, 0.85], dtype=torch.float32)
ARGS = {
"message": message,
"decoded_message": decoded_message,
}
- 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
|
| decoded_message_error_rate_batch |
Ran ran; our contract draft was wrong, not the code |
hurunyi/robust-wide/utils.py code served (permissive licence) · get_code("312ff076fac287f7") 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
torch.manual_seed(0)
# Create tiny batch of messages and decoded messages
# batch_size = 2, message_length = 4
messages = [
torch.rand(4),
torch.rand(4)
]
decoded_messages = [
torch.rand(4),
torch.rand(4)
]
ARGS = {
"messages": messages,
"decoded_messages": decoded_messages
}
- 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
|
| load_image |
Ran ran; our contract draft was wrong, not the code |
hurunyi/robust-wide/evaluate.py code served (permissive licence) · get_code("e093542bc06414d7") 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 Tensor, ndim 4, dtype family float, shape (1, 3, 256, 256) 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
from PIL import Image
import numpy as np
torch.manual_seed(0)
# Create a small test image as a PIL Image object
img_array = np.random.randint(0, 256, (64, 64, 3), dtype=np.uint8)
pil_img = Image.fromarray(img_array, mode='RGB')
ARGS = {
'imgname': pil_img,
'target_size': 256
}
- 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 Tensor, ndim 4, dtype family float, shape (1, 3, 256, 256) — shape (1, 3, 256, 256) 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
|
| preprocess_images |
Ran ran, honoured the contract we drafted |
hurunyi/robust-wide/dataset.py code served (permissive licence) · get_code("6bcd7bd2081d9725") 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 Tensor, ndim 3, dtype family float, shape (6, 16, 16) 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
import torch
from torchvision import transforms
from PIL import Image
torch.manual_seed(0)
# Create a small stand-in example dict with PIL Images
# The function expects examples['original_image'] to be a list of PIL Images
def create_dummy_image(size=32):
"""Create a small dummy PIL Image"""
img_array = np.random.randint(0, 256, (size, size, 3), dtype=np.uint8)
return Image.fromarray(img_array, mode='RGB')
examples = {
'original_image': [create_dummy_image(32), create_dummy_image(32)]
}
image_size = 16
ARGS = {
'examples': examples,
'image_size': image_size,
}
- 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 Tensor, ndim 3, dtype family float, shape (6, 16, 16) — shape (6, 16, 16) 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
|
| preprocess_train |
Ran ran; our contract draft was wrong, not the code |
hurunyi/robust-wide/dataset.py code served (permissive licence) · get_code("7ba441437913fb8d") 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 numpy as np
import torch
from torchvision import transforms
from PIL import Image
torch.manual_seed(0)
# Create small PIL images for testing
def create_dummy_image(size=32):
return Image.new('RGB', (size, size), color=(73, 109, 137))
# Create examples dict with required fields
examples = {
'original_image': [create_dummy_image(36), create_dummy_image(36)],
'edit_prompt': ['a cat', 'a dog']
}
image_size = 32
ARGS = {
'examples': examples,
'image_size': image_size
}
- 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 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
|
| str2bool |
Ran ran, violated the contract we drafted |
hurunyi/robust-wide/utils.py code served (permissive licence) · get_code("7c508037b40522af") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1) 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 argparse
def str2bool(v):
if isinstance(v, bool):
return v
if v.lower() in ('yes', 'true', 't', 'y', '1'):
return True
elif v.lower() in ('no', 'false', 'f', 'n', '0'):
return False
else:
raise argparse.ArgumentTypeError('Boolean value expected.')
# Test cases for str2bool
ARGS = {
'v': 'true' # string input that should convert to boolean
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1
- 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
|
| EncoderUnet |
Not yet run unverified (harvested, no recorded run) |
hurunyi/Robust-Wide/model.py code served (permissive licence) · get_code("61d082d3fdf98155") How it ran |
| Up |
Not yet run unverified (harvested, no recorded run) |
hurunyi/Robust-Wide/model.py code served (permissive licence) · get_code("51e0fb9e015af2d3") How it ran |
| WatermarkModel |
Not yet run unverified (harvested, no recorded run) |
hurunyi/Robust-Wide/model.py code served (permissive licence) · get_code("a1bb128109808e32") How it ran |