| CBatchNorm |
Ran ran on a synthesized input |
rehg-lab/3dshapegen/SDFNet/model.py code served (permissive licence) · get_code("a5d3d5e453d15b6a") 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 3, dtype family float, shape (2, 4, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
class CBatchNorm(nn.Module):
def __init__(self, latent_dim, feature_dim):
super().__init__()
self.latent_dim = latent_dim
self.feature_dim = feature_dim
self.conv_gamma = nn.Conv1d(self.latent_dim, self.feature_dim, 1)
self.conv_beta = nn.Conv1d(self.latent_dim, self.feature_dim, 1)
self.bn = nn.BatchNorm1d(self.feature_dim, affine=False)
self.reset_parameters()
def reset_parameters(self):
nn.init.zeros_(self.conv_gamma.weight)
nn.init.zeros_(self.conv_beta.weight)
nn.init.ones_(self.conv_gamma.bias)
nn.init.zeros_(self.conv_beta.bias)
def forward(self, x, c):
latent = c
assert x.size(0) == c.size(0)
assert c.size(1) == self.latent_dim
if len(c.size()) == 2:
c = c.unsqueeze(2)
gamma = self.conv_gamma(c)
beta = self.conv_beta(c)
net = self.bn(x)
out = gamma * net + beta
return out
INIT_ARGS = {
'latent_dim': 5,
'feature_dim': 4,
}
ARGS = {
'x': torch.randn(2, 4, 3),
'c': torch.randn(2, 5),
}
if __name__ == '__main__':
model = CBatchNorm(**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
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 3, dtype family float, shape (2, 4, 3) — shape (2, 4, 3) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| CResnetBlockConv |
Ran ran on a synthesized input |
rehg-lab/3dshapegen/SDFNet/model.py code served (permissive licence) · get_code("5a8b3823534d8170") 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 3, dtype family float, shape (2, 4, 7) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
# Import the classes
class CBatchNorm(nn.Module):
def __init__(self, latent_dim, feature_dim):
super().__init__()
self.latent_dim = latent_dim
self.feature_dim = feature_dim
self.conv_gamma = nn.Conv1d(self.latent_dim, self.feature_dim, 1)
self.conv_beta = nn.Conv1d(self.latent_dim, self.feature_dim, 1)
self.bn = nn.BatchNorm1d(self.feature_dim, affine=False)
self.reset_parameters()
def reset_parameters(self):
nn.init.zeros_(self.conv_gamma.weight)
nn.init.zeros_(self.conv_beta.weight)
nn.init.ones_(self.conv_gamma.bias)
nn.init.zeros_(self.conv_beta.bias)
def forward(self, x, c):
latent = c
assert x.size(0) == c.size(0)
assert c.size(1) == self.latent_dim
if len(c.size()) == 2:
c = c.unsqueeze(2)
gamma = self.conv_gamma(c)
beta = self.conv_beta(c)
net = self.bn(x)
out = gamma * net + beta
return out
class CResnetBlockConv(nn.Module):
def __init__(self, latent_dim, size_in, size_hidden=None, size_out=None):
super().__init__()
if size_hidden is None:
size_hidden = size_in
if size_out is None:
size_out = size_in
self.size_in = size_in
self.size_hidden = size_hidden
self.size_out = size_out
self.bn_0 = CBatchNorm(latent_dim, self.size_in)
self.bn_1 = CBatchNorm(latent_dim, self.size_hidden)
self.fc_0 = nn.Conv1d(self.size_in, self.size_hidden, 1)
self.fc_1 = nn.Conv1d(self.size_hidden, self.size_out, 1)
self.actvn = nn.ReLU()
nn.init.zeros_(self.fc_1.weight)
def forward(self, x, c):
net = self.fc_0(self.actvn(self.bn_0(x, c)))
dx = self.fc_1(self.actvn(self.bn_1(net, c)))
return x + dx
INIT_ARGS = {
'latent_dim': 5,
'size_in': 4,
'size_hidden': 3,
'size_out': 4,
}
ARGS = {
'x': torch.randn(2, 4, 7),
'c': torch.randn(2, 5),
}
- 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 3, dtype family float, shape (2, 4, 7) — shape (2, 4, 7) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| ConditionalBatchNorm1d |
Ran ran on a synthesized input · constructed an object; no result was computed |
christophreich1996/3d_baggage_segmentation/Models.py code served (permissive licence) · get_code("e7c52e325919019f") 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 an instance of its own class, ConditionalBatchNorm1d: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
import types as _types
torch.manual_seed(0)
# Define InstanceNorm1d as in the provided code
class InstanceNorm1d(nn.Module):
def __init__(self) -> None:
super(InstanceNorm1d, self).__init__()
def forward(self, input: torch.Tensor) -> torch.Tensor:
return (input - input.mean(dim=1, keepdim=True)) / input.std(dim=1, keepdim=True)
# Define get_normalization_1d as in the provided code
def get_normalization_1d(normalization: str, channels: int, channels_latent: int=None, affine: bool=True):
assert normalization in ['batchnorm', 'instancenorm', 'cbatchnorm', 'none'], 'Normalization {} is not available!'.format(normalization)
if normalization == 'batchnorm':
return nn.Sequential(nn.BatchNorm1d(channels, affine=affine))
elif normalization == 'instancenorm':
return nn.Sequential(ModelParts.InstanceNorm1d())
elif normalization == 'cbatchnorm':
return ModelParts.ConditionalBatchNorm1d(channels_latent, channels)
elif normalization == 'none':
return nn.Sequential()
else:
raise RuntimeError('Normalization {} is not available!'.format(normalization))
# Define ConditionalBatchNorm1d as in the provided code
class ConditionalBatchNorm1d(nn.Module):
def __init__(self, latent_channels: int, output_channels: int, bias: bool=True, normalization: str='batchnorm') -> None:
super(ConditionalBatchNorm1d, self).__init__()
self.linear_gamma = nn.Linear(in_features=latent_channels, out_features=output_channels, bias=bias)
self.linear_beta = nn.Linear(in_features=latent_channels, out_features=output_channels, bias=bias)
self.normalization = get_normalization_1d(normalization=normalization, channels=output_channels, affine=False)
self.reset_parameters()
def reset_parameters(self) -> None:
nn.init.zeros_(self.linear_gamma.weight)
nn.init.zeros_(self.linear_beta.weight)
nn.init.ones_(self.linear_gamma.bias)
nn.init.zeros_(self.linear_beta.bias)
def forward(self, input: torch.Tensor, latent_vector: torch.Tensor) -> torch.Tensor:
gamma = self.linear_gamma(latent_vector)
beta = self.linear_beta(latent_vector)
output_normalized = self.normalization(input)
gamma = torch.repeat_interleave(gamma, int(output_normalized.shape[0] / gamma.shape[0]), dim=0)
beta = torch.repeat_interleave(beta, int(output_normalized.shape[0] / beta.shape[0]), dim=0)
output = gamma * output_normalized + beta
return output
# Setup namespace for ModelParts
ModelParts = _types.SimpleNamespace(**{
'InstanceNorm1d': InstanceNorm1d,
'ConditionalBatchNorm1d': ConditionalBatchNorm1d,
})
# Create valid arguments for ConditionalBatchNorm1d.__init__
ARGS = {
'latent_channels': 5,
'output_channels': 4,
'bias': True,
'normalization': 'batchnorm'
}
- 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 ConditionalBatchNorm1d — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a ConditionalBatchNorm1d 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
|
| Decoder |
Ran ran on a synthesized input |
rehg-lab/3dshapegen/SDFNet/model.py code served (permissive licence) · get_code("38cda8bbfb5dde9b") 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; 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 the classes from the provided code
class CBatchNorm(nn.Module):
def __init__(self, latent_dim, feature_dim):
super().__init__()
self.latent_dim = latent_dim
self.feature_dim = feature_dim
self.conv_gamma = nn.Conv1d(self.latent_dim, self.feature_dim, 1)
self.conv_beta = nn.Conv1d(self.latent_dim, self.feature_dim, 1)
self.bn = nn.BatchNorm1d(self.feature_dim, affine=False)
self.reset_parameters()
def reset_parameters(self):
nn.init.zeros_(self.conv_gamma.weight)
nn.init.zeros_(self.conv_beta.weight)
nn.init.ones_(self.conv_gamma.bias)
nn.init.zeros_(self.conv_beta.bias)
def forward(self, x, c):
latent = c
assert x.size(0) == c.size(0)
assert c.size(1) == self.latent_dim
if len(c.size()) == 2:
c = c.unsqueeze(2)
gamma = self.conv_gamma(c)
beta = self.conv_beta(c)
net = self.bn(x)
out = gamma * net + beta
return out
class CResnetBlockConv(nn.Module):
def __init__(self, latent_dim, size_in, size_hidden=None, size_out=None):
super().__init__()
if size_hidden is None:
size_hidden = size_in
if size_out is None:
size_out = size_in
self.size_in = size_in
self.size_hidden = size_hidden
self.size_out = size_out
self.bn_0 = CBatchNorm(latent_dim, self.size_in)
self.bn_1 = CBatchNorm(latent_dim, self.size_hidden)
self.fc_0 = nn.Conv1d(self.size_in, self.size_hidden, 1)
self.fc_1 = nn.Conv1d(self.size_hidden, self.size_out, 1)
self.actvn = nn.ReLU()
nn.init.zeros_(self.fc_1.weight)
def forward(self, x, c):
net = self.fc_0(self.actvn(self.bn_0(x, c)))
dx = self.fc_1(self.actvn(self.bn_1(net, c)))
return x + dx
class Decoder(nn.Module):
def __init__(self, input_dim, latent_dim, size_hidden):
super().__init__()
self.fc_p = nn.Conv1d(input_dim, size_hidden, 1)
self.block0 = CResnetBlockConv(latent_dim, size_hidden)
self.block1 = CResnetBlockConv(latent_dim, size_hidden)
self.block2 = CResnetBlockConv(latent_dim, size_hidden)
self.block3 = CResnetBlockConv(latent_dim, size_hidden)
self.block4 = CResnetBlockConv(latent_dim, size_hidden)
self.bn = CBatchNorm(latent_dim, size_hidden)
self.fc_out = nn.Conv1d(size_hidden, 1, 1)
self.actvn = nn.ReLU()
def forward(self, p, c):
p = p.transpose(1, 2)
batch_size, D, T = p.size()
net = self.fc_p(p)
net = self.block0(net, c)
net = self.block1(net, c)
net = self.block2(net, c)
net = self.block3(net, c)
net = self.block4(net, c)
out = self.fc_out(self.actvn(self.bn(net, c)))
out = out.squeeze(1)
return out
INIT_ARGS = {
'input_dim': 3,
'latent_dim': 4,
'size_hidden': 8,
}
ARGS = {
'p': torch.randn(2, 5, 3),
'c': torch.randn(2, 4),
}
if __name__ == '__main__':
model = Decoder(**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
- 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 — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
- 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)
|
| Decoder |
Ran ran on a synthesized input |
LMescheder/Occupancy-Networks/im2mesh/onet/models/decoder.py code served (permissive licence) · get_code("f37015e827cec719") 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, 6) 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
class ResnetBlockFC(nn.Module):
""" Fully connected ResNet Block class.
Args:
size_in (int): input dimension
size_out (int): output dimension
size_h (int): hidden dimension
"""
def __init__(self, size_in, size_out=None, size_h=None):
super().__init__()
if size_out is None:
size_out = size_in
if size_h is None:
size_h = min(size_in, size_out)
self.size_in = size_in
self.size_h = size_h
self.size_out = size_out
self.fc_0 = nn.Linear(size_in, size_h)
self.fc_1 = nn.Linear(size_h, size_out)
self.actvn = nn.ReLU()
if size_in == size_out:
self.shortcut = None
else:
self.shortcut = nn.Linear(size_in, size_out, bias=False)
nn.init.zeros_(self.fc_1.weight)
def forward(self, x):
net = self.fc_0(self.actvn(x))
dx = self.fc_1(self.actvn(net))
if self.shortcut is not None:
x_s = self.shortcut(x)
else:
x_s = x
return x_s + dx
class Decoder(nn.Module):
""" Decoder class.
It does not perform any form of normalization.
Args:
dim (int): input dimension
z_dim (int): dimension of latent code z
c_dim (int): dimension of latent conditioned code c
hidden_size (int): hidden size of Decoder network
leaky (bool): whether to use leaky ReLUs
"""
def __init__(self, dim=3, z_dim=128, c_dim=128, hidden_size=128, leaky=False):
super().__init__()
self.z_dim = z_dim
self.c_dim = c_dim
self.fc_p = nn.Linear(dim, hidden_size)
if not z_dim == 0:
self.fc_z = nn.Linear(z_dim, hidden_size)
if not c_dim == 0:
self.fc_c = nn.Linear(c_dim, hidden_size)
self.block0 = ResnetBlockFC(hidden_size)
self.block1 = ResnetBlockFC(hidden_size)
self.block2 = ResnetBlockFC(hidden_size)
self.block3 = ResnetBlockFC(hidden_size)
self.block4 = ResnetBlockFC(hidden_size)
self.fc_out = nn.Linear(hidden_size, 1)
if not leaky:
self.actvn = F.relu
else:
self.actvn = lambda x: F.leaky_relu(x, 0.2)
def forward(self, p, z, c=None, **kwargs):
batch_size, T, D = p.size()
net = self.fc_p(p)
if self.z_dim != 0:
net_z = self.fc_z(z).unsqueeze(1)
net = net + net_z
if self.c_dim != 0:
net_c = self.fc_c(c).unsqueeze(1)
net = net + net_c
net = self.block0(net)
net = self.block1(net)
net = self.block2(net)
net = self.block3(net)
net = self.block4(net)
out = self.fc_out(self.actvn(net))
out = out.squeeze(-1)
return out
INIT_ARGS = {
'dim': 3,
'z_dim': 4,
'c_dim': 5,
'hidden_size': 8,
'leaky': False,
}
ARGS = {
'p': torch.randn(2, 6, 3),
'z': torch.randn(2, 4),
'c': torch.randn(2, 5),
}
if __name__ == '__main__':
decoder = Decoder(**INIT_ARGS)
output = decoder(**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
- 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, 6) — shape (2, 6) 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)
|
| Encoder |
Ran ran on a synthesized input |
devlearning-gt/3DShapeGen/SDFNet/model.py code served (permissive licence) · get_code("a3b3c07599560188") 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; 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
from torchvision import models
import numpy as np
# Mock config
class MockConfig:
path = {
'src_dataset_path': '/mock/path',
'input_image_path': None,
'input_depth_path': 'depth_NPZ',
'input_normal_path': 'normal_output',
'input_seg_path': 'segmentation',
'src_pt_path': '/mock/path',
'data_split_json_path': '/mock/path'
}
config = MockConfig()
# INIT_ARGS for Encoder
INIT_ARGS = {
'latent_dim': 4,
'pretrained': False
}
# ARGS for forward pass
batch_size = 2
input_channels = 4 # matches the modified conv1 in Encoder
height, width = 8, 8 # small spatial dimensions
input_tensor = torch.randn(batch_size, input_channels, height, width)
ARGS = {
'x': input_tensor
}
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- 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 2, dtype family float — no output shape is stated: observe_signature.py observed this class with its constructor sizes canonicalised where it could, which the node does not record, so its shape is not stated as this setup block's
- 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)
|
| InstanceNorm1d |
Ran ran on a synthesized input · constructed an object; no result was computed |
christophreich1996/3d_baggage_segmentation/Models.py code served (permissive licence) · get_code("0e6a060ed43a0f4c") 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 an instance of its own class, InstanceNorm1d: the run constructed the object and did not call it, so no result was computed. 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 InstanceNorm1d(nn.Module):
"""
Implementation of instance normalization for a 2D tensor of shape (batch size, features)
"""
def __init__(self) -> None:
super(InstanceNorm1d, self).__init__()
def forward(self, input: torch.Tensor) -> torch.Tensor:
return (input - input.mean(dim=1, keepdim=True)) / input.std(dim=1, keepdim=True)
# Create a small tensor with batch size 2 and features 4
input_tensor = torch.randn(2, 4)
# The InstanceNorm1d constructor takes no parameters
ARGS = {}
- 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 InstanceNorm1d — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a InstanceNorm1d 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
|
| VolumeEncoderBlock |
Ran ran on a synthesized input · constructed an object; no result was computed |
christophreich1996/3d_baggage_segmentation/Models.py code served (permissive licence) · get_code("7a2b40f0ed90d6c4") 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 an instance of its own class, VolumeEncoderBlock: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
import torch.nn.functional as F
torch.manual_seed(0)
class Misc:
@staticmethod
def get_activation(activation: str) -> nn.Sequential:
"""
Method to return different types of activation functions
:param activation: (str) Type of activation ('relu', 'leaky relu', 'elu', 'prlu', 'selu', 'sigmoid', 'identity')
:return: (nn.Sequential) Activation function
"""
assert activation in ['relu', 'leaky relu', 'elu', 'prelu', 'selu', 'sigmoid', 'identity'], 'Activation {} is not available!'.format(activation)
if activation == 'relu':
return nn.Sequential(nn.ReLU())
elif activation == 'leaky relu':
return nn.Sequential(nn.LeakyReLU())
elif activation == 'elu':
return nn.Sequential(nn.ELU())
elif activation == 'prelu':
return nn.Sequential(nn.PReLU())
elif activation == 'selu':
return nn.Sequential(nn.SELU())
elif activation == 'sigmoid':
return nn.Sequential(nn.Sigmoid())
elif activation == 'identity':
return nn.Sequential()
else:
raise RuntimeError('Activation {} is not available!'.format(activation))
@staticmethod
def get_downsampling_3d(downsampling: str, factor: int=2, channels: int=0) -> nn.Sequential:
"""
Method to return different types of 3D downsampling operations
:param downsampling: (str) Type of donwsnapling ('maxpool', 'averagepool', 'convolution', 'none')
:param factor: (int) Factor of downsampling
:param channels: (int) Number of channels (only for convolution)
:return: (nn.Sequential) Downsampling operation
"""
assert downsampling in ['maxpool', 'averagepool', 'convolution', 'none'], 'Downsampling {} is not available'.format(downsampling)
if downsampling == 'maxpool':
return nn.Sequential(nn.MaxPool3d(kernel_size=factor, stride=factor))
elif downsampling == 'averagepool':
return nn.Sequential(nn.AvgPool3d(kernel_size=factor, stride=factor))
elif downsampling == 'convolution':
return nn.Sequential(nn.Conv3d(in_channels=channels, out_channels=channels, kernel_size=factor, stride=factor, padding=0, bias=True))
elif downsampling == 'none':
return nn.Sequential()
else:
raise RuntimeError('Downsampling {} is not available'.format(downsampling))
@staticmethod
def get_normalization_3d(normalization: str, channels: int, affine: bool=True) -> nn.Sequential:
"""
Method to return different types of 3D normalization operations
:param normalization: (str) Type of normalization ('batchnorm', 'instancenorm')
:param channels: (int) Number of channels to use
:return: (nn.Sequential) Normalization operation
"""
assert normalization in ['batchnorm', 'instancenorm', 'none'], 'Normalization {} is not available!'.format(normalization)
if normalization == 'batchnorm':
return nn.Sequential(nn.BatchNorm3d(channels, affine=affine))
elif normalization == 'instancenorm':
return nn.Sequential(nn.InstanceNorm3d(channels, affine=affine))
elif normalization == 'none':
return nn.Identity()
else:
raise RuntimeError('Normalization {} is not available!'.format(normalization))
ARGS = {
'input_channels': 3,
'output_channels': 4,
'kernel_size': 3,
'stride': 1,
'padding': 1,
'activation': 'prelu',
'downsampling': 'averagepool',
'downsampling_factor': 2,
'normalization': 'batchnorm',
'dropout_rate': 0.0,
'bias': 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 VolumeEncoderBlock — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a VolumeEncoderBlock 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
|
| conv3x3 |
Ran ran; our contract draft was wrong, not the code |
ThibaultGROUEIX/AtlasNet/model/resnet.py pointer only (licence: MIT); the stored copy get_code serves, from lixiaotong97/DSU, is pointer only (licence: NONE) · get_code("fac5364e2f53c6db") How it ranThe 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 lixiaotong97/DSU, 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. |
| get_activation |
Ran ran; our contract draft was wrong, not the code |
christophreich1996/3d_baggage_segmentation/Models.py code served (permissive licence) · get_code("24958c347025b8f9") 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 Sequential. 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)
# The function get_activation takes a single parameter: activation (str)
# It returns an nn.Sequential module based on the activation type string
# The function validates that activation is one of the allowed strings
# and returns the corresponding Sequential wrapper
ARGS = {
'activation': 'relu'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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_activation |
Ran ran on a synthesized input |
ThibaultGROUEIX/AtlasNet/model/model_blocks.py code served (permissive licence) · get_code("eb0fbd226a44a62d") 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 function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn.functional as F
torch.manual_seed(0)
# The function get_activation takes a single argument: 'argument'
# which is a string key to look up an activation function in a dictionary
# Valid keys are: 'relu', 'sigmoid', 'softplus', 'logsigmoid', 'softsign', 'tanh'
ARGS = {
'argument': 'relu'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_downsampling_3d |
Ran ran; our contract draft was wrong, not the code |
christophreich1996/3d_baggage_segmentation/Models.py code served (permissive licence) · get_code("b8017368dd60b4fa") 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 Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
ARGS = {
'downsampling': 'maxpool',
'factor': 2,
'channels': 3,
}
- 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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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_normalization_1d |
Ran ran; our contract draft was wrong, not the code |
christophreich1996/3d_baggage_segmentation/Models.py code served (permissive licence) · get_code("6b9643e62afcbba5") 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 Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
import types as _types
torch.manual_seed(0)
# Define InstanceNorm1d
class InstanceNorm1d(nn.Module):
def __init__(self) -> None:
super(InstanceNorm1d, self).__init__()
def forward(self, input: torch.Tensor) -> torch.Tensor:
return (input - input.mean(dim=1, keepdim=True)) / input.std(dim=1, keepdim=True)
# Define ConditionalBatchNorm1d
class ConditionalBatchNorm1d(nn.Module):
def __init__(self, latent_channels: int, output_channels: int, bias: bool=True, normalization: str='batchnorm') -> None:
super(ConditionalBatchNorm1d, self).__init__()
self.linear_gamma = nn.Linear(in_features=latent_channels, out_features=output_channels, bias=bias)
self.linear_beta = nn.Linear(in_features=latent_channels, out_features=output_channels, bias=bias)
self.normalization = get_normalization_1d(normalization=normalization, channels=output_channels, affine=False)
self.reset_parameters()
def reset_parameters(self) -> None:
nn.init.zeros_(self.linear_gamma.weight)
nn.init.zeros_(self.linear_beta.weight)
nn.init.ones_(self.linear_gamma.bias)
nn.init.zeros_(self.linear_beta.bias)
def forward(self, input: torch.Tensor, latent_vector: torch.Tensor) -> torch.Tensor:
gamma = self.linear_gamma(latent_vector)
beta = self.linear_beta(latent_vector)
output_normalized = self.normalization(input)
gamma = torch.repeat_interleave(gamma, int(output_normalized.shape[0] / gamma.shape[0]), dim=0)
beta = torch.repeat_interleave(beta, int(output_normalized.shape[0] / beta.shape[0]), dim=0)
output = gamma * output_normalized + beta
return output
# Define get_normalization_1d
def get_normalization_1d(normalization: str, channels: int, channels_latent: int=None, affine: bool=True):
assert normalization in ['batchnorm', 'instancenorm', 'cbatchnorm', 'none'], 'Normalization {} is not available!'.format(normalization)
if normalization == 'batchnorm':
return nn.Sequential(nn.BatchNorm1d(channels, affine=affine))
elif normalization == 'instancenorm':
return nn.Sequential(InstanceNorm1d())
elif normalization == 'cbatchnorm':
return ConditionalBatchNorm1d(channels_latent, channels)
elif normalization == 'none':
return nn.Sequential()
else:
raise RuntimeError('Normalization {} is not available!'.format(normalization))
# Create namespace
ModelParts = _types.SimpleNamespace(**{
'ConditionalBatchNorm1d': ConditionalBatchNorm1d,
'InstanceNorm1d': InstanceNorm1d,
})
Misc = _types.SimpleNamespace(**{
'get_normalization_1d': get_normalization_1d,
})
ARGS = {
'normalization': 'batchnorm',
'channels': 4,
'channels_latent': 3,
'affine': 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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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_normalization_3d |
Ran ran; our contract draft was wrong, not the code |
christophreich1996/3d_baggage_segmentation/Models.py code served (permissive licence) · get_code("8edd5d305dae763a") 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 Sequential. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
ARGS = {
'normalization': 'batchnorm',
'channels': 64,
'affine': 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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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
|
| normalize |
Ran ran on a synthesized input |
christophreich1996/oss-net/misc.py code served (permissive licence) · get_code("a937df6834dbd922") 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 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
torch.manual_seed(0)
# Create a small tensor with shape (2, 4)
# The function expects a torch.Tensor and will compute mean and std on it
input_tensor = torch.randn(2, 4)
ARGS = {
"input": input_tensor
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| normalize_0_1 |
Ran ran on a synthesized input |
christophreich1996/oss-net/misc.py code served (permissive licence) · get_code("ef1ee00d64e35a9c") 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 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
torch.manual_seed(0)
# Create a small tensor with values that need normalization
# Using a 2x4 tensor (batch size 2, 4 features)
input_tensor = torch.tensor([
[1.0, 2.0, 3.0, 4.0],
[5.0, 6.0, 7.0, 8.0]
])
ARGS = {
"input": input_tensor
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| normalize_0_1_slice |
Ran ran on a synthesized input |
christophreich1996/oss-net/misc.py code served (permissive licence) · get_code("6cdb8cfcb6e89ec1") 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 2, dtype family float, shape (2, 4) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
torch.manual_seed(0)
# Create a small tensor with shape (2, 4) - batch size 2, 4 features
# This will test the slice-wise normalization across the last dimension
input_tensor = torch.randn(2, 4)
ARGS = {
"input": input_tensor
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 4) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| parse_to_list |
Ran ran, honoured the contract we drafted |
christophreich1996/3d_baggage_segmentation/Models.py code served (permissive licence) · get_code("de526b0533f1a228") 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, ndim 1, dtype family int; 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 numpy as np
from typing import List, Tuple, Union
torch.manual_seed(0)
# Test case 1: primitive int with length
args_1 = {
'possible_list': 5,
'length': 3,
'name': 'test_param'
}
# Test case 2: list of primitives matching length
args_2 = {
'possible_list': [1, 2, 3, 4],
'length': 4,
'name': 'block_list'
}
# Test case 3: boolean primitive
args_3 = {
'possible_list': True,
'length': 2,
'name': 'enable_flag'
}
# Test case 4: float primitive
args_4 = {
'possible_list': 3.14,
'length': 5,
'name': 'learning_rate'
}
# Test case 5: string primitive
args_5 = {
'possible_list': 'relu',
'length': 3,
'name': 'activation'
}
# Test case 6: list with mixed types
args_6 = {
'possible_list': [1, 'conv', True, 2.5],
'length': 4,
'name': 'config_list'
}
# Test case 7: tuple as single element
args_7 = {
'possible_list': (1, 2, 3),
'length': 2,
'name': 'shape_tuple'
}
# Use the simplest case for ARGS
ARGS = {
'possible_list': 42,
'length': 3,
'name': 'test'
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type list, ndim 1, dtype family int — 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
|
| resnet18 |
Ran ran; our contract draft was wrong, not the code |
ThibaultGROUEIX/AtlasNet/model/resnet.py code served (permissive licence) · get_code("e1f318dcee5ac8f4") 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 ResNet. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
ARGS = {
'pretrained': False,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ResNet — a ResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| resnet34 |
Ran ran; our contract draft was wrong, not the code |
ThibaultGROUEIX/AtlasNet/model/resnet.py code served (permissive licence) · get_code("7020202576e20cf8") 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 ResNet. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
import math
torch.manual_seed(0)
ARGS = {
'pretrained': False,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ResNet — a ResNet output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ResNet output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| CoordinatesFullyConnectedBlock |
Not yet run unverified (harvested, no recorded run) |
christophreich1996/3d_baggage_segmentation/Models.py code served (permissive licence) · get_code("c16c86b82cfe44c2") How it ran |
| OccupancyNetwork |
Not yet run unverified (harvested, no recorded run) |
christophreich1996/3d_baggage_segmentation/Models.py code served (permissive licence) · get_code("13b7e4eeb3052bef") How it ran |
| SDFNet |
Not yet run unverified (harvested, no recorded run) |
devlearning-gt/3DShapeGen/SDFNet/model.py code served (permissive licence) · get_code("05b2f9257f2f4c52") How it ran |