| ASPP |
Ran ran on a synthesized input |
yuk6heo/GIS-RAmap/networks/network.py code served (permissive licence) · get_code("5d294ba4ebefb3b2") 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; 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 numpy as np
from collections import OrderedDict
# Setup for FutureResult and SyncMaster
class MockBatchNorm(nn.Module):
def __init__(self, num_features):
super(MockBatchNorm, self).__init__()
self.weight = nn.Parameter(torch.ones(num_features))
self.bias = nn.Parameter(torch.zeros(num_features))
self.running_mean = torch.zeros(num_features)
self.running_var = torch.ones(num_features)
def forward(self, x):
return torch.nn.functional.batch_norm(
x, self.running_mean, self.running_var,
self.weight, self.bias, training=False
)
class SynchronizedBatchNorm2d(MockBatchNorm):
pass # Mock for testing
# Mock SlavePipe
class SlavePipe:
def __init__(self, identifier, queue, future):
self.identifier = identifier
self.queue = queue
self.future = future
def __call__(self, msg):
self.queue.put((self.identifier, msg))
return self.future.get()
# Mock _MasterRegistry
class _MasterRegistry:
def __init__(self, future):
self.result = future
# ASPP class setup
class ASPP(nn.Module):
def __init__(self, backbone, output_stride, BatchNorm, pretrained=False):
super(ASPP, self).__init__()
assert backbone in ['drn', 'mobilenet', 'resnet']
assert output_stride in [8, 16]
if backbone == 'drn':
inplanes = 512
elif backbone == 'mobilenet':
inplanes = 320
else:
inplanes = 2048
if output_stride == 16:
dilations = [1, 6, 12, 18]
elif output_stride == 8:
dilations = [1, 12, 24, 36]
self.aspp1 = _ASPPModule(inplanes, 256, 1, padding=0, dilation=dilations[0], BatchNorm=BatchNorm, pretrained=pretrained)
self.aspp2 = _ASPPModule(inplanes, 256, 3, padding=dilations[1], dilation=dilations[1], BatchNorm=BatchNorm, pretrained=pretrained)
self.aspp3 = _ASPPModule(inplanes, 256, 3, padding=dilations[2], dilation=dilations[2], BatchNorm=BatchNorm, pretrained=pretrained)
self.aspp4 = _ASPPModule(inplanes, 256, 3, padding=dilations[3], dilation=dilations[3], BatchNorm=BatchNorm, pretrained=pretrained)
self.global_avg_pool = nn.Sequential(
nn.AdaptiveAvgPool2d((1, 1)),
nn.Conv2d(inplanes, 256, 1, stride=1, bias=False),
BatchNorm(256),
nn.ReLU()
)
self.conv1 = nn.Conv2d(1280, 256, 1, bias=False)
self.bn1 = BatchNorm(256)
self.relu = nn.ReLU()
self.dropout = nn.Dropout(0.5)
self._init_weight(pretrained)
def forward(self, x):
x1 = self.aspp1(x)
x2 = self.aspp2(x)
x3 = self.aspp3(x)
x4 = self.aspp4(x)
x5 = self.global_avg_pool(x)
x5 = F.interpolate(x5, size=x4.size()[2:], mode='bilinear', align_corners=True)
x = torch.cat((x1, x2, x3, x4, x5), dim=1)
x = self.conv1(x)
x = self.bn1(x)
x = self.relu(x)
return self.dropout(x)
def _init_weight(self, pretrained):
for m in self.modules():
if pretrained:
break
elif isinstance(m, nn.Conv2d):
torch.nn.init.kaiming_normal_(m.weight)
elif isinstance(m, SynchronizedBatchNorm2d):
m.weight.data.fill_(1)
m.bias.data.zero_()
elif isinstance(m, nn.BatchNorm2d):
m.weight.data.fill_(1)
m.bias.data.zero_()
# Setup INIT_ARGS and ARGS
INIT_ARGS = {
'backbone': 'resnet',
'output_stride': 16,
'BatchNorm': MockBatchNorm,
'pretrained': False
}
# Create input tensor for forward pass
input_tensor = torch.randn(2, 2048, 4, 3) # batch=2, channels=2048, height=4, width=3
ARGS = {'x': input_tensor}
- 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 4, 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)
|
| Attention_Transfer_Module |
Ran ran on a synthesized input |
yuk6heo/GIS-RAmap/networks/network.py code served (permissive licence) · get_code("3e73a6c8f46e0d29") 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 numpy as np
INIT_ARGS = {}
ARGS = {
"anno_feature_list": [
torch.randn(2, 1024, 4, 3),
torch.randn(2, 1024, 4, 3),
torch.randn(2, 1024, 4, 3)
],
"que_feature": torch.randn(2, 1024, 4, 3),
"anno_indicator_feature_list": [
torch.randn(2, 256, 4, 3),
torch.randn(2, 256, 4, 3),
torch.randn(2, 256, 4, 3)
],
"anno_fr_list": [0.1, 0.3, 0.5],
"que_fr": 0.2,
"debug": False
}
- 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 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)
|
| IAware_Diff_Prop_Module |
Ran ran on a synthesized input |
yuk6heo/GIS-RAmap/networks/network.py code served (permissive licence) · get_code("631f000ad5eea50e") 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; 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
# INIT_ARGS is empty because __init__ takes no parameters beyond self
INIT_ARGS = {}
# Create the module to determine the expected input shapes
# The module expects:
# - neighbor_pred_onehot: B,1,H,W
# - r4_nei: B,1024,H/8,W/8 (since neighbor_pred_onehot is downsampled by 0.125)
# - r4_que: B,1024,H/8,W/8
# Let's use small dimensions:
# B = 2 (batch size)
# H = 64, W = 48 (original spatial dimensions)
# After 0.125 scale: H/8 = 8, W/8 = 6
B = 2
H = 64
W = 48
H_small = 8
W_small = 6
neighbor_pred_onehot = torch.randn(B, 1, H, W)
r4_nei = torch.randn(B, 1024, H_small, W_small)
r4_que = torch.randn(B, 1024, H_small, W_small)
ARGS = {
'neighbor_pred_onehot': neighbor_pred_onehot,
'r4_nei': r4_nei,
'r4_que': r4_que
}
- 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 — 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)
|
| Object_Feature_Extractor |
Ran ran on a synthesized input · constructed an object; no result was computed |
yuk6heo/GIS-RAmap/networks/network.py code served (permissive licence) · get_code("f6af305ad4f4f5bb") 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, Object_Feature_Extractor: 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)
# Define the SEBottleneck and Object_Feature_Extractor classes
class SEBottleneck(nn.Module):
expansion = 4
def __init__(self, inplanes, planes, stride=1, dilation=1, downsample=None, BatchNorm=nn.BatchNorm2d):
super(SEBottleneck, self).__init__()
self.conv1 = nn.Conv2d(inplanes, planes, kernel_size=1, bias=False)
self.bn1 = BatchNorm(planes)
self.conv2 = nn.Conv2d(planes, planes, kernel_size=3, stride=stride, dilation=dilation, padding=dilation, bias=False)
self.bn2 = BatchNorm(planes)
self.conv3 = nn.Conv2d(planes, planes * self.expansion, kernel_size=1, bias=False)
self.bn3 = BatchNorm(planes * self.expansion)
self.relu = nn.ReLU(inplace=True)
self.global_pool = nn.AdaptiveAvgPool2d(1)
self.conv_down = nn.Conv2d(planes * 4, planes // 4, kernel_size=1, bias=False)
self.conv_up = nn.Conv2d(planes // 4, planes * 4, kernel_size=1, bias=False)
self.sig = nn.Sigmoid()
self.downsample = downsample
self.stride = stride
self.dilation = dilation
def forward(self, x):
residual = x
out = self.conv1(x)
out = self.bn1(out)
out = self.relu(out)
out = self.conv2(out)
out = self.bn2(out)
out = self.relu(out)
out = self.conv3(out)
out = self.bn3(out)
out1 = self.global_pool(out)
out1 = self.conv_down(out1)
out1 = self.relu(out1)
out1 = self.conv_up(out1)
out1 = self.sig(out1)
if self.downsample is not None:
residual = self.downsample(x)
res = out1 * out + residual
res = self.relu(res)
return res
class Object_Feature_Extractor(nn.Module):
def __init__(self):
super(Object_Feature_Extractor, self).__init__()
downsample1 = nn.Conv2d(512, 256, kernel_size=1, stride=2, bias=False)
self.block1 = SEBottleneck(512, 64, stride=2, downsample=downsample1)
self.conv16_8 = nn.Conv2d(2048, 256, kernel_size=1, stride=1)
self.conv8_8 = nn.Conv2d(512, 256, kernel_size=1, stride=1)
self.conv_cat = nn.Conv2d(768, 256, kernel_size=3, stride=1, padding=1)
def forward(self, r5, r4, m2):
"""
:param r5: 1/16, 2048
:param r4: 1/8, 1024
:param m2: 1/4, 512
:return:
"""
m4 = self.block1(m2)
r5 = self.conv16_8(r5)
r5_r4 = F.interpolate(r5, scale_factor=2, mode='bilinear', align_corners=True)
r4 = self.conv8_8(r4)
x = torch.cat((r5_r4, r4, m4), dim=1)
x = self.conv_cat(x)
return x
# Create sample inputs for forward pass
# r5: 1/16 spatial resolution, 2048 channels, batch 2
r5 = torch.randn(2, 2048, 4, 5)
# r4: 1/8 spatial resolution, 1024 channels, batch 2
r4 = torch.randn(2, 1024, 8, 10)
# m2: 1/4 spatial resolution, 512 channels, batch 2
m2 = torch.randn(2, 512, 16, 20)
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 Object_Feature_Extractor — 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 Object_Feature_Extractor 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
|
| Refine |
Ran ran on a synthesized input · constructed an object; no result was computed |
yuk6heo/GIS-RAmap/networks/network.py code served (permissive licence) · get_code("3041bd5ec9f44211") 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, Refine: 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 Refine(nn.Module):
def __init__(self, inplanes, planes, scale_factor=2):
super(Refine, self).__init__()
self.convFS1 = nn.Conv2d(inplanes, planes, kernel_size=3, padding=1)
self.convFS2 = nn.Conv2d(planes, planes, kernel_size=3, padding=1)
self.convFS3 = nn.Conv2d(planes, planes, kernel_size=3, padding=1)
self.convMM1 = nn.Conv2d(planes, planes, kernel_size=3, padding=1)
self.convMM2 = nn.Conv2d(planes, planes, kernel_size=3, padding=1)
self.scale_factor = scale_factor
def forward(self, f, pm):
s = self.convFS1(f)
sr = self.convFS2(F.relu(s))
sr = self.convFS3(F.relu(sr))
s = s + sr
m = s + F.interpolate(pm, scale_factor=self.scale_factor, mode='bilinear', align_corners=True)
mr = self.convMM1(F.relu(m))
mr = self.convMM2(F.relu(mr))
m = m + mr
return m
# Create tensors for forward pass
# f should have shape (batch, inplanes, height, width)
# pm should have shape (batch, planes, height//scale_factor, width//scale_factor)
f = torch.randn(2, 4, 8, 8) # batch=2, inplanes=4, height=8, width=8
pm = torch.randn(2, 6, 4, 4) # batch=2, planes=6, height=4, width=4 (for scale_factor=2)
ARGS = {
'inplanes': 4,
'planes': 6,
'scale_factor': 2
}
- 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 Refine — 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 Refine 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
|
| SEBottleneck |
Ran ran on a synthesized input |
yuk6heo/GIS-RAmap/networks/network.py code served (permissive licence) · get_code("06ffcf0e3cfa1604") 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; 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
# Create a downsample module for when stride != 1 or inplanes != planes * expansion
inplanes = 8
planes = 4
stride = 2
downsample = nn.Sequential(
nn.Conv2d(inplanes, planes * 4, kernel_size=1, stride=stride, bias=False),
nn.BatchNorm2d(planes * 4)
)
INIT_ARGS = {
'inplanes': inplanes,
'planes': planes,
'stride': stride,
'dilation': 1,
'downsample': downsample,
'BatchNorm': nn.BatchNorm2d
}
# Input tensor: batch_size=2, channels=inplanes, height=8, width=6
x = torch.randn(2, inplanes, 8, 6)
ARGS = {
'x': x
}
- 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 — 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)
|
| Segmentation_Head |
Ran ran on a synthesized input |
yuk6heo/GIS-RAmap/networks/network.py code served (permissive licence) · get_code("1a19f4a94b9d1cb0") 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; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
import torch.nn.functional as F
class Segmentation_Head(nn.Module):
def __init__(self):
super(Segmentation_Head, self).__init__()
self.conv1 = nn.Conv2d(256, 256, kernel_size=3, padding=1)
self.bn1 = nn.BatchNorm2d(256)
self.conv2 = nn.Conv2d(256, 128, kernel_size=5, padding=2)
self.bn2 = nn.BatchNorm2d(128)
self.conv3 = nn.Conv2d(128, 128, kernel_size=5, padding=2)
self.bn3 = nn.BatchNorm2d(128)
self.conv4 = nn.Conv2d(128, 64, kernel_size=5, padding=2)
self.bn4 = nn.BatchNorm2d(64)
self.conv5 = nn.Conv2d(64, 2, kernel_size=1, stride=1)
def forward(self, seg_feature):
"""
:return:
"""
x = self.bn1(self.conv1(seg_feature))
x = nn.Dropout(0.5)(F.relu(x))
x = self.bn2(self.conv2(x))
x = nn.Dropout(0.1)(F.relu(x))
x = self.bn3(self.conv3(x))
x = nn.Dropout(0.1)(F.relu(x))
x = self.bn4(self.conv4(x))
x = self.conv5(F.relu(x))
x = F.interpolate(x, scale_factor=4, mode='bilinear', align_corners=True)
return x
INIT_ARGS = {}
ARGS = {
'seg_feature': torch.randn(2, 256, 8, 12)
}
if __name__ == '__main__':
model = Segmentation_Head(**INIT_ARGS)
model.eval()
output = model(**ARGS)
print(f"Output shape: {output.shape}")
print(f"Output dtype: {output.dtype}")
- 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 — 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 |
Not yet run unverified (harvested, no recorded run) |
yuk6heo/GIS-RAmap/networks/network.py code served (permissive licence) · get_code("d27eb70dbb31fe71") How it ran |
| Encoder_3ch |
Not yet run unverified (harvested, no recorded run) |
yuk6heo/GIS-RAmap/networks/network.py code served (permissive licence) · get_code("1c13464af9161765") How it ran |
| Encoder_6ch |
Not yet run unverified (harvested, no recorded run) |
yuk6heo/GIS-RAmap/networks/network.py code served (permissive licence) · get_code("eb71cf025cd1ba36") How it ran |
| Feature_compounder |
Not yet run unverified (harvested, no recorded run) |
yuk6heo/GIS-RAmap/networks/network.py code served (permissive licence) · get_code("126d4988ead70a46") How it ran |
| NET_GAmap |
Not yet run unverified (harvested, no recorded run) |
yuk6heo/GIS-RAmap/networks/network.py code served (permissive licence) · get_code("55148a353d14b106") How it ran |
| ResNet |
Not yet run unverified (harvested, no recorded run) |
yuk6heo/GIS-RAmap/networks/network.py code served (permissive licence) · get_code("515db67b886be72d") How it ran |
| SEResNet50 |
Not yet run unverified (harvested, no recorded run) |
yuk6heo/GIS-RAmap/networks/network.py code served (permissive licence) · get_code("0b8f2a42511fa4a9") How it ran |
| _ASPPModule |
Not yet run unverified (harvested, no recorded run) |
yuk6heo/GIS-RAmap/networks/network.py code served (permissive licence) · get_code("a7ff513da63125b9") How it ran |