| ConvLayer |
Ran ran on a synthesized input |
christophhoenes/anomalousexoplanettransits/architectures.py code served (permissive licence) · get_code("cee46964326d3513") 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, 8, 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 numpy as np
import warnings
def select_activation_function(activation):
if activation in ['ReLU', 'relu']:
return nn.ReLU()
elif activation.startswith('LeakyReLU') or activation.startswith('leaky_relu'):
try:
act_strip = activation.strip('LeakyReLU')
act_strip = act_strip.strip('leaky_relu')
act_strip = act_strip.strip('_')
return nn.LeakyReLU(negative_slope=float(act_strip))
except ValueError:
return nn.LeakyReLU()
elif activation in ['PReLU', 'prelu']:
return nn.PReLU()
elif activation in ['GELU', 'gelu']:
return nn.GELU()
elif activation in ['ELU', 'elu']:
return nn.ELU()
elif activation in ['SELU', 'selu']:
return nn.SELU()
elif activation in ['Tanh', 'tanh']:
return nn.Tanh()
elif activation in ['Sigmoid', 'sigmoid']:
return nn.Sigmoid()
elif activation in ['Softplus', 'softplus']:
return nn.Softplus
else:
warnings.warn('Activation function "{}" is unknown! No activation will be used.'.format(activation), RuntimeWarning)
return None
class ConvLayer(nn.Module):
def __init__(self, in_channels=16, out_channels=16, kernel_size=5, stride=1, padding=None, padding_mode='zeros', dilation=1, activation='ReLU', batch_norm=True, transpose=False, bias=None):
super(ConvLayer, self).__init__()
self.in_channels = in_channels
self.out_channels = out_channels
self.kernel_size = kernel_size
self.stride = stride
self.padding = padding
self.dilation = dilation
self.activation = activation
self.batch_norm = batch_norm
if padding is None:
padding_amount = int(np.ceil(dilation * (kernel_size - 1) / 2))
else:
padding_amount = padding
if transpose:
modules = [nn.ConvTranspose1d(in_channels, out_channels, kernel_size, stride=stride, padding=padding_amount, padding_mode=padding_mode, output_padding=stride - 1 if padding_amount > 0 else 0, dilation=dilation, bias=not batch_norm if bias is None else bias)]
else:
modules = [nn.Conv1d(in_channels, out_channels, kernel_size, stride=stride, padding=padding_amount, padding_mode=padding_mode, dilation=dilation, bias=not batch_norm if bias is None else bias)]
if batch_norm:
modules.append(nn.BatchNorm1d(out_channels))
if activation is not None:
modules.append(select_activation_function(activation))
self._components = nn.Sequential(*modules)
def forward(self, x):
return self._components(x)
INIT_ARGS = {
'in_channels': 4,
'out_channels': 8,
'kernel_size': 3,
'stride': 1,
'padding': None,
'padding_mode': 'zeros',
'dilation': 1,
'activation': 'ReLU',
'batch_norm': True,
'transpose': False,
'bias': None,
}
ARGS = {
'x': torch.randn(2, 4, 16),
}
if __name__ == '__main__':
layer = ConvLayer(**INIT_ARGS)
output = layer(**ARGS)
print(f"Input shape: {ARGS['x'].shape}")
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 3, dtype family float, shape (2, 8, 16) — shape (2, 8, 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)
|
| GlobalAvgPool1d |
Ran ran on a synthesized input |
christophhoenes/anomalousexoplanettransits/architectures.py code served (permissive licence) · get_code("73780839e6b08582") 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; 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
# INIT_ARGS for GlobalAvgPool1d.__init__
INIT_ARGS = {
'map_size': None,
'channel_dim': -1
}
# ARGS for GlobalAvgPool1d.forward
# Create a 3D tensor (batch, channels, sequence_length)
# Using distinct dimensions: batch=2, channels=5, sequence_length=7
x = torch.randn(2, 5, 7)
ARGS = {
'x': x
}
- 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 3, 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)
|
| GlobalMaxPool1d |
Ran ran on a synthesized input |
christophhoenes/anomalousexoplanettransits/architectures.py code served (permissive licence) · get_code("124991c1258ee4f2") 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, 1) 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 GlobalMaxPool1d(nn.Module):
def __init__(self, map_size=None, channel_dim=-1):
super(GlobalMaxPool1d, self).__init__()
self.map_size = map_size
self.channel_dim = channel_dim
def forward(self, x):
return x.max(dim=self.channel_dim, keepdim=True).values
INIT_ARGS = {
'map_size': None,
'channel_dim': -1
}
ARGS = {
'x': torch.randn(2, 4, 3)
}
if __name__ == '__main__':
model = GlobalMaxPool1d(**INIT_ARGS)
output = model(**ARGS)
print(f"Input shape: {ARGS['x'].shape}")
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, 1) — shape (2, 4, 1) 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)
|
| LinearLayer |
Ran ran on a synthesized input |
christophhoenes/anomalousexoplanettransits/architectures.py code served (permissive licence) · get_code("cb07fa1cfe45efb6") 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, 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
import warnings
def select_activation_function(activation):
if activation in ['ReLU', 'relu']:
return nn.ReLU()
elif activation.startswith('LeakyReLU') or activation.startswith('leaky_relu'):
try:
act_strip = activation.strip('LeakyReLU')
act_strip = act_strip.strip('leaky_relu')
act_strip = act_strip.strip('_')
return nn.LeakyReLU(negative_slope=float(act_strip))
except ValueError:
return nn.LeakyReLU()
elif activation in ['PReLU', 'prelu']:
return nn.PReLU()
elif activation in ['GELU', 'gelu']:
return nn.GELU()
elif activation in ['ELU', 'elu']:
return nn.ELU()
elif activation in ['SELU', 'selu']:
return nn.SELU()
elif activation in ['Tanh', 'tanh']:
return nn.Tanh()
elif activation in ['Sigmoid', 'sigmoid']:
return nn.Sigmoid()
elif activation in ['Softplus', 'softplus']:
return nn.Softplus()
else:
warnings.warn('Activation function "{}" is unknown! No activation will be used.'.format(activation), RuntimeWarning)
return None
class LinearLayer(nn.Module):
def __init__(self, in_channels=16, out_channels=16, dropout=0.0, activation=None, batch_norm=False):
super(LinearLayer, self).__init__()
self.activation = activation
self.in_channels = in_channels
self.out_channels = out_channels
self.dropout = dropout
self.batch_norm = batch_norm
modules = [nn.Linear(in_channels, out_channels)]
if self.activation is not None:
modules.append(select_activation_function(activation))
if batch_norm:
modules.append(nn.BatchNorm1d(out_channels))
if dropout > 0.0:
modules.append(nn.Dropout(p=self.dropout))
self._components = nn.Sequential(*modules)
def forward(self, x):
return self._components(x)
INIT_ARGS = {
'in_channels': 4,
'out_channels': 3,
'dropout': 0.1,
'activation': 'ReLU',
'batch_norm': True
}
ARGS = {
'x': torch.randn(2, 4)
}
layer = LinearLayer(**INIT_ARGS)
output = layer(**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 2, dtype family float, shape (2, 3) — shape (2, 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)
|
| MeanPool1d |
Ran ran on a synthesized input |
christophhoenes/anomalousexoplanettransits/architectures.py code served (permissive licence) · get_code("e80ba618fb269491") 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 tuple. 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
class MeanPool1d(nn.Module):
def __init__(self, kernel_size, stride, padding=0, return_indices=True):
super(MeanPool1d, self).__init__()
self.kernel_size = kernel_size
self.stride = stride
self.return_indices = return_indices
self.padding = padding
def forward(self, x):
if self.return_indices:
return (F.avg_pool1d(x, self.kernel_size, stride=self.stride, padding=self.padding), None)
else:
F.avg_pool1d(x, self.kernel_size, stride=self.stride, padding=self.padding)
INIT_ARGS = {
'kernel_size': 3,
'stride': 2,
'padding': 1,
'return_indices': True
}
ARGS = {
'x': torch.randn(2, 4, 8)
}
if __name__ == '__main__':
model = MeanPool1d(**INIT_ARGS)
output = model(**ARGS)
print(f"Output type: {type(output)}")
print(f"Output shape: {output[0].shape if isinstance(output, tuple) else 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 tuple — a tuple output has no array shape of its own; none is stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| PoolingLayer |
Ran ran on a synthesized input |
christophhoenes/anomalousexoplanettransits/architectures.py code served (permissive licence) · get_code("3862b8e4d2bc7b10") 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; 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 warnings
import torch.nn.functional as F
class GlobalAvgPool1d(nn.Module):
def __init__(self, map_size=None, channel_dim=-1):
super(GlobalAvgPool1d, self).__init__()
self.map_size = map_size
self.channel_dim = channel_dim
def forward(self, x):
return x.mean(dim=self.channel_dim, keepdim=True)
class GlobalMaxPool1d(nn.Module):
def __init__(self, map_size=None, channel_dim=-1):
super(GlobalMaxPool1d, self).__init__()
self.map_size = map_size
self.channel_dim = channel_dim
def forward(self, x):
return x.max(dim=self.channel_dim, keepdim=True).values
class MeanPool1d(nn.Module):
def __init__(self, kernel_size, stride, padding=0, return_indices=True):
super(MeanPool1d, self).__init__()
self.kernel_size = kernel_size
self.stride = stride
self.return_indices = return_indices
self.padding = padding
def forward(self, x):
if self.return_indices:
return (F.avg_pool1d(x, self.kernel_size, stride=self.stride, padding=self.padding), None)
else:
F.avg_pool1d(x, self.kernel_size, stride=self.stride, padding=self.padding)
class StridePool1d(nn.Module):
def __init__(self, pool_kernel, pool_stride, channels, padding=0, activation='ReLU', batch_norm=False):
super(StridePool1d, self).__init__()
self.layer = nn.Conv1d(channels, channels, kernel_size=pool_kernel, stride=pool_stride, padding=padding)
self.activation = select_activation_function(activation)
self.batch_norm = nn.BatchNorm1d(channels) if batch_norm else None
def forward(self, x):
out = self.layer(x) if self.batch_norm is None else self.batch_norm(self.layer(x))
return out if self.activation is None else self.activation(out)
def select_activation_function(activation):
if activation in ['ReLU', 'relu']:
return nn.ReLU()
elif activation.startswith('LeakyReLU') or activation.startswith('leaky_relu'):
try:
act_strip = activation.strip('LeakyReLU')
act_strip = act_strip.strip('leaky_relu')
act_strip = act_strip.strip('_')
return nn.LeakyReLU(negative_slope=float(act_strip))
except ValueError:
return nn.LeakyReLU()
elif activation in ['PReLU', 'prelu']:
return nn.PReLU()
elif activation in ['GELU', 'gelu']:
return nn.GELU()
elif activation in ['ELU', 'elu']:
return nn.ELU()
elif activation in ['SELU', 'selu']:
return nn.SELU()
elif activation in ['Tanh', 'tanh']:
return nn.Tanh()
elif activation in ['Sigmoid', 'sigmoid']:
return nn.Sigmoid()
elif activation in ['Softplus', 'softplus']:
return nn.Softplus
else:
warnings.warn('Activation function "{}" is unknown! No activation will be used.'.format(activation), RuntimeWarning)
return None
class PoolingLayer(nn.Module):
def __init__(self, out_channels=None, pool_type='stride', pool_kernel=2, pool_stride=2, pool_padding=None, map_size=None):
super(PoolingLayer, self).__init__()
self.out_channels = out_channels
self.pool_type = pool_type
self.pool_kernel = pool_kernel
self.pool_stride = pool_stride
self.pool_padding = pool_padding
self.map_size = map_size
self._indices = None
if pool_padding == None:
pool_padding = (pool_kernel - 1) // 2
if pool_type == 'max_indices':
self.pooling = nn.MaxPool1d(pool_kernel, pool_stride, padding=pool_padding, return_indices=True)
elif pool_type == 'max':
self.pooling = nn.MaxPool1d(pool_kernel, pool_stride, padding=pool_padding, return_indices=False)
elif pool_type == 'mean':
self.pooling = MeanPool1d(pool_kernel, pool_stride, padding=pool_padding, return_indices=False)
elif pool_type == 'global_max':
self.pooling = GlobalMaxPool1d(map_size)
elif pool_type == 'global_avg':
self.pooling = GlobalAvgPool1d(map_size)
elif pool_type == 'stride':
assert out_channels is not None, "Passing the number of channels of the previous layer is required for pool_type 'stride'!"
self.pooling = StridePool1d(pool_kernel, pool_stride, out_channels, padding=pool_padding)
else:
raise RuntimeWarning('Unknown Pooling function {} encountered!'.format(self.pooling))
@property
def indices(self):
return self._indices
def forward(self, x):
if self.pool_type == 'max_indices':
out, indices = self.pooling(x)
self._indices = indices
return out
return self.pooling(x)
INIT_ARGS = {
'out_channels': 4,
'pool_type': 'stride',
'pool_kernel': 2,
'pool_stride': 2,
'pool_padding': None,
'map_size': None,
}
ARGS = {
'x': torch.randn(2, 4, 8),
}
if __name__ == '__main__':
model = PoolingLayer(**INIT_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 3, 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)
|
| StridePool1d |
Ran ran on a synthesized input |
christophhoenes/anomalousexoplanettransits/architectures.py code served (permissive licence) · get_code("238ca52eff8cac7a") 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, 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
import torch.nn as nn
import warnings
def select_activation_function(activation):
if activation in ['ReLU', 'relu']:
return nn.ReLU()
elif activation.startswith('LeakyReLU') or activation.startswith('leaky_relu'):
try:
act_strip = activation.strip('LeakyReLU')
act_strip = act_strip.strip('leaky_relu')
act_strip = act_strip.strip('_')
return nn.LeakyReLU(negative_slope=float(act_strip))
except ValueError:
return nn.LeakyReLU()
elif activation in ['PReLU', 'prelu']:
return nn.PReLU()
elif activation in ['GELU', 'gelu']:
return nn.GELU()
elif activation in ['ELU', 'elu']:
return nn.ELU()
elif activation in ['SELU', 'selu']:
return nn.SELU()
elif activation in ['Tanh', 'tanh']:
return nn.Tanh()
elif activation in ['Sigmoid', 'sigmoid']:
return nn.Sigmoid()
elif activation in ['Softplus', 'softplus']:
return nn.Softplus()
else:
warnings.warn('Activation function "{}" is unknown! No activation will be used.'.format(activation), RuntimeWarning)
return None
class StridePool1d(nn.Module):
def __init__(self, pool_kernel, pool_stride, channels, padding=0, activation='ReLU', batch_norm=False):
super(StridePool1d, self).__init__()
self.layer = nn.Conv1d(channels, channels, kernel_size=pool_kernel, stride=pool_stride, padding=padding)
self.activation = select_activation_function(activation)
self.batch_norm = nn.BatchNorm1d(channels) if batch_norm else None
def forward(self, x):
out = self.layer(x) if self.batch_norm is None else self.batch_norm(self.layer(x))
return out if self.activation is None else self.activation(out)
INIT_ARGS = {
'pool_kernel': 3,
'pool_stride': 2,
'channels': 4,
'padding': 1,
'activation': 'ReLU',
'batch_norm': False
}
ARGS = {
'x': torch.randn(2, 4, 8)
}
if __name__ == '__main__':
model = StridePool1d(**INIT_ARGS)
output = model(**ARGS)
print(f"Input shape: {ARGS['x'].shape}")
print(f"Output shape: {output.shape}")
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 3, dtype family float, shape (2, 4, 4) — shape (2, 4, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| StrideUnPool1d |
Ran ran on a synthesized input |
christophhoenes/anomalousexoplanettransits/architectures.py code served (permissive licence) · get_code("fb3ad5d0baba37c6") 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, 17) 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 warnings
def select_activation_function(activation):
if activation in ['ReLU', 'relu']:
return nn.ReLU()
elif activation.startswith('LeakyReLU') or activation.startswith('leaky_relu'):
try:
act_strip = activation.strip('LeakyReLU')
act_strip = act_strip.strip('leaky_relu')
act_strip = act_strip.strip('_')
return nn.LeakyReLU(negative_slope=float(act_strip))
except ValueError:
return nn.LeakyReLU()
elif activation in ['PReLU', 'prelu']:
return nn.PReLU()
elif activation in ['GELU', 'gelu']:
return nn.GELU()
elif activation in ['ELU', 'elu']:
return nn.ELU()
elif activation in ['SELU', 'selu']:
return nn.SELU()
elif activation in ['Tanh', 'tanh']:
return nn.Tanh()
elif activation in ['Sigmoid', 'sigmoid']:
return nn.Sigmoid()
elif activation in ['Softplus', 'softplus']:
return nn.Softplus
else:
warnings.warn('Activation function "{}" is unknown! No activation will be used.'.format(activation), RuntimeWarning)
return None
class StrideUnPool1d(nn.Module):
def __init__(self, pool_kernel, pool_stride, channels, padding=0, activation='ReLU', batch_norm=False):
super(StrideUnPool1d, self).__init__()
self.layer = nn.ConvTranspose1d(channels, channels, kernel_size=pool_kernel, stride=pool_stride, padding=padding)
self.activation = select_activation_function(activation)
self.batch_norm = nn.BatchNorm1d(channels) if batch_norm else None
def forward(self, x):
out = self.layer(x) if self.batch_norm is None else self.batch_norm(self.layer(x))
return out if self.activation is None else self.activation(out)
INIT_ARGS = {
'pool_kernel': 3,
'pool_stride': 2,
'channels': 4,
'padding': 0,
'activation': 'ReLU',
'batch_norm': False
}
ARGS = {
'x': torch.randn(2, 4, 8)
}
if __name__ == '__main__':
model = StrideUnPool1d(**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, 17) — shape (2, 4, 17) 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)
|
| UnFlatten |
Ran ran on a synthesized input |
christophhoenes/anomalousexoplanettransits/architectures.py code served (permissive licence) · get_code("07a296880eef7407") 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, 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
import torch.nn as nn
class UnFlatten(nn.Module):
def __init__(self, channels):
super(UnFlatten, self).__init__()
self.channels = channels
def forward(self, x):
return x.unflatten(1, (self.channels, x.size()[1] // self.channels))
INIT_ARGS = {
'channels': 4
}
ARGS = {
'x': torch.randn(2, 16)
}
if __name__ == '__main__':
model = UnFlatten(**INIT_ARGS)
output = model(**ARGS)
print(f"Input shape: {ARGS['x'].shape}")
print(f"Output shape: {output.shape}")
print(f"Output:\n{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, 4) — shape (2, 4, 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: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| Upsample1d |
Ran ran on a synthesized input |
christophhoenes/anomalousexoplanettransits/architectures.py code served (permissive licence) · get_code("2d764b73a39b8e5e") 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, 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
class Upsample1d(torch.nn.Module):
def __init__(self, scale_factor):
super(Upsample1d, self).__init__()
self._scale_factor = scale_factor
self._module = nn.UpsamplingNearest2d(scale_factor=scale_factor)
@property
def scale_factor(self):
return self._scale_factor
def forward(self, x):
out = torch.unsqueeze(x, 3)
out = self._module(out)
return out[:, :, :, 0]
INIT_ARGS = {
'scale_factor': 2
}
ARGS = {
'x': torch.randn(2, 4, 3)
}
if __name__ == '__main__':
model = Upsample1d(**INIT_ARGS)
output = model(**ARGS)
print(f"Input shape: {ARGS['x'].shape}")
print(f"Output shape: {output.shape}")
print(f"Scale factor: {model.scale_factor}")
- 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, 6) — shape (2, 4, 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)
|
| VerticalFitter |
Ran ran on a synthesized input |
christophhoenes/anomalousexoplanettransits/architectures.py code served (permissive licence) · get_code("502c4c43de0bc288") 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 tuple. 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
class VerticalFitter(nn.Module):
def __init__(self, size):
super(VerticalFitter, self).__init__()
self.influence_trend1 = torch.linspace(1.0, 0.0, size).unsqueeze(dim=0).unsqueeze(dim=0)
self.influence_trend2 = torch.ones(size) - self.influence_trend1
def _apply(self, fn):
super(VerticalFitter, self)._apply(fn)
self.influence_trend1 = fn(self.influence_trend1)
self.influence_trend2 = fn(self.influence_trend2)
return self
def forward(self, data, model, scale, trend):
oot_model = model.max(dim=-1, keepdims=True).values
model -= oot_model
model *= 1.0 - scale.unsqueeze(dim=1).unsqueeze(dim=1)
model += trend[:, 0].unsqueeze(dim=1).unsqueeze(dim=1) * self.influence_trend1 + trend[:, 1].unsqueeze(dim=1).unsqueeze(dim=1) * self.influence_trend2
vertical_loss = F.mse_loss(model, data)
return (model.detach(), vertical_loss)
INIT_ARGS = {
'size': 5
}
ARGS = {
'data': torch.randn(2, 3, 5),
'model': torch.randn(2, 3, 5),
'scale': torch.randn(2),
'trend': torch.randn(2, 2)
}
if __name__ == '__main__':
fitter = VerticalFitter(**INIT_ARGS)
output_model, loss = fitter(**ARGS)
print(f"Output model shape: {output_model.shape}")
print(f"Loss: {loss.item()}")
- 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 tuple — a tuple output has no array shape of its own; none is stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| select_activation_function |
Ran ran; our contract draft was wrong, not the code |
christophhoenes/anomalousexoplanettransits/architectures.py code served (permissive licence) · get_code("68a933eee54ea1c9") 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 ReLU. 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 warnings
torch.manual_seed(0)
# The function takes a single parameter: activation (a string)
# It checks the activation string against various patterns and returns
# the corresponding nn.Module or None
ARGS = {
'activation': 'ReLU'
}
- 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 ReLU — a ReLU output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ReLU 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
|
| CustomVAE |
Not yet run unverified (harvested, no recorded run) |
christophhoenes/anomalousexoplanettransits/architectures.py code served (permissive licence) · get_code("fd6c571d2dd20aa2") How it ran |
| MaxUnPool1d |
Not yet run unverified (harvested, no recorded run) |
christophhoenes/anomalousexoplanettransits/architectures.py code served (permissive licence) · get_code("da8a1627fadb7154") How it ran |
| MeanUnool1d |
Not yet run unverified (harvested, no recorded run) |
christophhoenes/anomalousexoplanettransits/architectures.py code served (permissive licence) · get_code("86d470da61f23a5f") How it ran |
| ResBlock |
Not yet run unverified (harvested, no recorded run) |
christophhoenes/anomalousexoplanettransits/architectures.py code served (permissive licence) · get_code("325d2e47b1c6ab8b") How it ran |
| TransitShapeVAE |
Not yet run unverified (harvested, no recorded run) |
christophhoenes/anomalousexoplanettransits/architectures.py code served (permissive licence) · get_code("32e152287c3fa2e3") How it ran |
| UnPoolingLayer |
Not yet run unverified (harvested, no recorded run) |
christophhoenes/anomalousexoplanettransits/architectures.py code served (permissive licence) · get_code("c576df2e5f57b644") How it ran |
| VAE |
Not yet run unverified (harvested, no recorded run) |
christophhoenes/anomalousexoplanettransits/architectures.py code served (permissive licence) · get_code("ae4700404a606f78") How it ran |
| create_custom_network |
Not yet run unverified (harvested, no recorded run) |
christophhoenes/anomalousexoplanettransits/architectures.py code served (permissive licence) · get_code("aa45df8e57bc564e") How it ran |
| create_custom_network |
Not yet run unverified (harvested, no recorded run) |
christophhoenes/anomalousexoplanettransits/architectures.py code served (permissive licence) · get_code("bb380f0f47bc9c7c") How it ran |
| local_outlier_factor |
Not yet run unverified (harvested, no recorded run) |
christophhoenes/anomalousexoplanettransits/anomaly_detection.py code served (permissive licence) · get_code("c678e7ec5c49e802") How it ran |
| mahalanobis_distance |
Not yet run unverified (harvested, no recorded run) |
christophhoenes/anomalousexoplanettransits/anomaly_detection.py code served (permissive licence) · get_code("88de2f51668310c9") How it ranno invocation recorded. this sample carries JSON test cases instead of a setup block; get_reference_implementation serves them with the level they back. |
| one_class_svm |
Not yet run unverified (harvested, no recorded run) |
christophhoenes/anomalousexoplanettransits/anomaly_detection.py code served (permissive licence) · get_code("1e9a2a20ec63f538") How it ran |
| select_activation_function |
Not yet run unverified (harvested, no recorded run) |
christophhoenes/anomalousexoplanettransits/architectures.py code served (permissive licence) · get_code("de4eb295a57a97e1") How it ranno invocation recorded. this sample carries JSON test cases instead of a setup block; get_reference_implementation serves them with the level they back. |