| DOLGLocalBranch |
Ran ran on a synthesized input |
innat/DOLG-TensorFlow/models/DOLG.py code served (permissive licence) · get_code("0e1735ffbfaaabee") 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 EagerTensor, 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 tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
import numpy as np
# Set seeds for reproducibility
tf.random.set_seed(42)
np.random.seed(42)
# Define the MultiAtrous class
class MultiAtrous(keras.Model):
def __init__(self, dilation_rates=[6, 12, 18], upsampling=1, kernel_size=3, padding='same', **kwargs):
super(MultiAtrous, self).__init__(name='MultiAtrous', **kwargs)
self.dilation_rates = dilation_rates
self.kernel_size = kernel_size
self.upsampling = upsampling
self.padding = padding
self.dilated_convs = [layers.Conv2D(filters=int(1024 / 4), kernel_size=self.kernel_size, padding=self.padding, dilation_rate=rate) for rate in self.dilation_rates]
self.gap_branch = keras.Sequential([layers.GlobalAveragePooling2D(keepdims=True), layers.Conv2D(int(1024 / 2), kernel_size=1), layers.Activation('relu'), layers.UpSampling2D(size=self.upsampling, interpolation='bilinear')], name='gap_branch')
def call(self, inputs, training=None, **kwargs):
local_feature = []
for dilated_conv in self.dilated_convs:
x = dilated_conv(inputs)
x = self.gap_branch(x)
local_feature.append(x)
return tf.concat(local_feature, axis=-1)
def get_config(self):
config = {'dilation_rates': self.dilation_rates, 'kernel_size': self.kernel_size, 'padding': self.padding, 'upsampling': self.upsampling}
base_config = super(MultiAtrous, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
# Define the DOLGLocalBranch class
class DOLGLocalBranch(keras.Model):
def __init__(self, IMG_SIZE, **kwargs):
super(DOLGLocalBranch, self).__init__(name='LocalBranch', **kwargs)
self.multi_atrous = MultiAtrous(padding='same', upsampling=int(IMG_SIZE / 32))
self.conv1 = layers.Conv2D(1024, kernel_size=1)
self.conv2 = layers.Conv2D(1024, kernel_size=1, use_bias=False)
self.conv3 = layers.Conv2D(1024, kernel_size=1)
self.bn = layers.BatchNormalization()
def call(self, inputs, training=None, **kwargs):
local_feat = self.multi_atrous(inputs)
local_feat = self.conv1(local_feat)
local_feat = tf.nn.relu(local_feat)
local_feat = self.conv2(local_feat)
local_feat = self.bn(local_feat)
norm_local_feat = tf.math.l2_normalize(local_feat)
attn_map = tf.nn.relu(local_feat)
attn_map = self.conv3(attn_map)
attn_map = keras.activations.softplus(attn_map)
return norm_local_feat * attn_map
# Setup code
INIT_ARGS = {
'IMG_SIZE': 64
}
# Create input tensor: batch_size=2, height=64, width=64, channels=3
inputs = tf.random.normal((2, 64, 64, 3))
ARGS = {
'inputs': inputs,
'training': False
}
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type EagerTensor, 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)
|
| GeneralizedMeanPooling2D |
Ran ran on a synthesized input |
innat/DOLG-TensorFlow/models/DOLG.py code served (permissive licence) · get_code("eb1f7279fa17703b") 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 EagerTensor, ndim 2, dtype family float, shape (2, 8) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
class GeneralizedMeanPooling2D(layers.Layer):
def __init__(self, init_norm=3.0, normalize=False, epsilon=1e-06, **kwargs):
self.init_norm = init_norm
self.normalize = normalize
self.epsilon = epsilon
super(GeneralizedMeanPooling2D, self).__init__(**kwargs)
def build(self, input_shape):
self.p = self.add_weight(name='norms', shape=(input_shape[-1],), initializer=keras.initializers.constant(self.init_norm), trainable=True)
super(GeneralizedMeanPooling2D, self).build(input_shape)
def call(self, inputs):
x = tf.abs(tf.maximum(self.epsilon, inputs))
x = tf.pow(x, self.p)
x = tf.reduce_mean(x, axis=[1, 2], keepdims=False)
x = tf.pow(x, 1.0 / self.p)
if self.normalize:
x = tf.nn.l2_normalize(x, 1)
return x
def get_config(self):
config = {'init_norm': self.init_norm, 'normalize': self.normalize, 'epsilon': self.epsilon}
base_config = super(GeneralizedMeanPooling2D, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
INIT_ARGS = {
'init_norm': 3.0,
'normalize': False,
'epsilon': 1e-06
}
ARGS = {
'inputs': tf.random.normal((2, 4, 3, 8))
}
if __name__ == '__main__':
layer = GeneralizedMeanPooling2D(**INIT_ARGS)
output = layer(**ARGS)
print("Output shape:", output.shape)
print("Output:", output)
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type EagerTensor, ndim 2, dtype family float, shape (2, 8) — shape (2, 8) as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: torch and numpy seeded to 0 by the harness immediately before the class was constructed from INIT_ARGS (fixture_check.py)
|
| MultiAtrous |
Ran ran on a synthesized input |
innat/DOLG-TensorFlow/models/DOLG.py code served (permissive licence) · get_code("6b3acd9aecd4def9") 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 EagerTensor, 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 tensorflow as tf
from tensorflow import keras
from tensorflow.keras import layers
INIT_ARGS = {
'dilation_rates': [6, 12, 18],
'upsampling': 1,
'kernel_size': 3,
'padding': 'same',
}
ARGS = {
'inputs': tf.random.normal((2, 8, 8, 256)),
}
class MultiAtrous(keras.Model):
def __init__(self, dilation_rates=[6, 12, 18], upsampling=1, kernel_size=3, padding='same', **kwargs):
super(MultiAtrous, self).__init__(name='MultiAtrous', **kwargs)
self.dilation_rates = dilation_rates
self.kernel_size = kernel_size
self.upsampling = upsampling
self.padding = padding
self.dilated_convs = [layers.Conv2D(filters=int(1024 / 4), kernel_size=self.kernel_size, padding=self.padding, dilation_rate=rate) for rate in self.dilation_rates]
self.gap_branch = keras.Sequential([layers.GlobalAveragePooling2D(keepdims=True), layers.Conv2D(int(1024 / 2), kernel_size=1), layers.Activation('relu'), layers.UpSampling2D(size=self.upsampling, interpolation='bilinear')], name='gap_branch')
def call(self, inputs, training=None, **kwargs):
local_feature = []
for dilated_conv in self.dilated_convs:
x = dilated_conv(inputs)
x = self.gap_branch(x)
local_feature.append(x)
return tf.concat(local_feature, axis=-1)
def get_config(self):
config = {'dilation_rates': self.dilation_rates, 'kernel_size': self.kernel_size, 'padding': self.padding, 'upsampling': self.upsampling}
base_config = super(MultiAtrous, self).get_config()
return dict(list(base_config.items()) + list(config.items()))
if __name__ == '__main__':
model = MultiAtrous(**INIT_ARGS)
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
- tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type EagerTensor, 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)
|
| OrthogonalFusion |
Ran ran on a synthesized input |
innat/DOLG-TensorFlow/models/DOLG.py code served (permissive licence) · get_code("399f81dfa6feffde") 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 EagerTensor, 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 tensorflow as tf
from tensorflow.keras import layers
class OrthogonalFusion(layers.Layer):
def __init__(self, **kwargs):
super().__init__(name='OrthogonalFusion', **kwargs)
def call(self, inputs):
local_feat, global_feat = inputs
height = local_feat.shape[1]
width = local_feat.shape[2]
depth = local_feat.shape[3]
local_feat = tf.reshape(local_feat, [-1, height * width, depth])
local_feat = tf.transpose(local_feat, perm=[0, 2, 1])
projection = tf.matmul(tf.expand_dims(global_feat, axis=1), local_feat)
projection = tf.matmul(tf.expand_dims(global_feat, axis=2), projection)
projection = tf.reshape(projection, [-1, height, width, depth])
global_feat_norm = tf.norm(global_feat, ord=2, axis=1)
projection = projection / tf.reshape(global_feat_norm * global_feat_norm, shape=[-1, 1, 1, 1])
local_feat = tf.transpose(local_feat, perm=[0, 1, 2])
local_feat = tf.reshape(local_feat, [-1, height, width, depth])
orthogonal_comp = local_feat - projection
global_feat = tf.expand_dims(tf.expand_dims(global_feat, axis=1), axis=1)
global_feat = tf.broadcast_to(global_feat, tf.shape(local_feat))
output = tf.concat([global_feat, orthogonal_comp], axis=-1)
return output
INIT_ARGS = {}
ARGS = {
'inputs': [
tf.random.normal([2, 4, 3, 8]),
tf.random.normal([2, 8])
]
}
if __name__ == '__main__':
layer = OrthogonalFusion(**INIT_ARGS)
output = layer(ARGS['inputs'])
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
- tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type EagerTensor, 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)
|
| adaptative_avg_pool2d |
Ran ran on a synthesized input |
Shiro-LK/python-DOLG/dolg/resnet_tf2.py code served (permissive licence) · get_code("0ebf59946affa912") 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 EagerTensor, ndim 4, dtype family float, shape (2, 2, 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 tensorflow as tf
import numpy as np
# Create a small test input tensor
# Shape: (batch=2, height=8, width=6, channels=3)
x = tf.constant(np.random.randn(2, 8, 6, 3).astype(np.float32))
# Define output_dim as an integer
output_dim = 2
ARGS = {
"x": x,
"output_dim": output_dim,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type EagerTensor, ndim 4, dtype family float, shape (2, 2, 2, 3) — shape (2, 2, 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: none by the harness; any seed is in the setup block
|
| cache_url |
Ran ran; our contract draft was wrong, not the code |
feymanpriv/DOLG/core/io.py code served (permissive licence) · get_code("f623b3e3625d4e42") 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 str. 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 os
import tempfile
import re
# Create a temporary directory to use as cache_dir
cache_dir = tempfile.mkdtemp()
# Test case 1: local file path (not a URL)
local_file_path = "/path/to/local/file.txt"
# Test case 2: URL that matches the pycls base URL pattern
# We'll use a valid-looking URL but won't actually try to download
pycls_url = "https://dl.fbaipublicfiles.com/pycls/models/model.pth"
# For testing purposes, we'll use a local file path since downloading is not allowed
url_or_file = local_file_path
ARGS = {
"url_or_file": url_or_file,
"cache_dir": cache_dir
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
|
| complexity_batchnorm2d |
Ran ran; our contract draft was wrong, not the code |
feymanpriv/DOLG/core/net.py code served (permissive licence) · get_code("4136b6e9df422178") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
# The function expects:
# - cx: a dict with keys 'h', 'w', 'flops', 'params', 'acts'
# - w_in: an integer representing input width/channels
# Construct the cx dict with all required keys
cx = {
'h': 32, # height dimension
'w': 64, # width dimension
'flops': 1000, # floating point operations
'params': 500, # number of parameters
'acts': 2048 # number of activations
}
# w_in is the input width/channels for BatchNorm2D
w_in = 16
ARGS = {
'cx': cx,
'w_in': w_in
}
- 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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| complexity_conv2d |
Ran ran; our contract draft was wrong, not the code |
feymanpriv/DOLG/core/net.py code served (permissive licence) · get_code("b299737079f619a1") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
torch.manual_seed(0)
# Construct a valid complexity state dictionary
cx = {
'h': 32, # height
'w': 32, # width
'flops': 0, # floating point operations
'params': 0, # parameters
'acts': 0 # activations
}
# Conv2D parameters
w_in = 3 # input channels
w_out = 64 # output channels
k = 3 # kernel size
stride = 1 # stride
padding = 1 # padding
groups = 1 # groups (default)
bias = False # bias (default)
ARGS = {
'cx': cx,
'w_in': w_in,
'w_out': w_out,
'k': k,
'stride': stride,
'padding': padding,
'groups': groups,
'bias': bias
}
- 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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| complexity_maxpool2d |
Ran ran; our contract draft was wrong, not the code |
feymanpriv/DOLG/core/net.py code served (permissive licence) · get_code("ee4b7c6aef3ebb1f") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
# Create a valid complexity context dict
cx = {
'h': 32,
'w': 32,
'flops': 1000,
'params': 100,
'acts': 500
}
# Define kernel size, stride, and padding for MaxPool2d
k = 2
stride = 2
padding = 0
# Map all parameters to their values
ARGS = {
'cx': cx,
'k': k,
'stride': stride,
'padding': padding
}
- 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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| dump_log_data |
Ran ran on a synthesized input |
feymanpriv/DOLG/core/logging.py code served (permissive licence) · get_code("7defe868d1a6d115") 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 str. 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 decimal
import simplejson
import torch
import numpy as np
_TAG = 'json_stats: '
_TYPE = '_type'
def float_to_decimal(data, prec=4):
"""Convert floats to decimals which allows for fixed width json."""
if isinstance(data, dict):
return {k: float_to_decimal(v, prec) for k, v in data.items()}
if isinstance(data, float):
return decimal.Decimal(('{:.' + str(prec) + 'f}').format(data))
else:
return data
def dump_log_data(data, data_type, prec=4):
"""Covert data (a dictionary) into tagged json string for logging."""
data[_TYPE] = data_type
data = float_to_decimal(data, prec)
data_json = simplejson.dumps(data, sort_keys=True, use_decimal=True)
return '{:s}{:s}'.format(_TAG, data_json)
torch.manual_seed(0)
ARGS = {
'data': {
'loss': 0.5234,
'accuracy': 0.9876,
'learning_rate': 0.001,
'epoch': 42,
'nested_metric': {
'train_loss': 0.3456,
'val_loss': 0.4567
}
},
'data_type': 'training_metrics',
'prec': 4
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, simplejson, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
|
| extract_embedding_pt |
Ran ran on a synthesized input |
Shiro-LK/python-DOLG/dolg/utils/extraction.py code served (permissive licence) · get_code("b428876a811ea78e") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (1, 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 numpy as np
import tempfile
import os
import cv2
torch.manual_seed(0)
# Create a temporary directory and a dummy image file
temp_dir = tempfile.mkdtemp()
dummy_image = np.random.randint(0, 256, (512, 512, 3), dtype=np.uint8)
image_path = os.path.join(temp_dir, "test_image.jpg")
cv2.imwrite(image_path, dummy_image)
# Create a minimal model that satisfies the function's usage
class DummyModel(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(3 * 512 * 512, 4)
def forward(self, x):
# x shape: (batch, 3, 512, 512)
batch_size = x.shape[0]
x = x.view(batch_size, -1)
output = self.linear(x)
return output
model = DummyModel()
ARGS = {
"filename": "test_image.jpg",
"root_dir": temp_dir,
"model": model
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- cv2, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 2, dtype family float, shape (1, 4) — shape (1, 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
|
| extract_embedding_tf |
Ran ran on a synthesized input |
Shiro-LK/python-DOLG/dolg/utils/extraction.py code served (permissive licence) · get_code("447c96f744ac2f44") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned ndarray, ndim 2, dtype family float, shape (1, 128) 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 tempfile
import os
import cv2
# Create a temporary directory and a dummy image file
temp_dir = tempfile.mkdtemp()
dummy_img = np.random.randint(0, 256, (512, 512, 3), dtype=np.uint8)
img_path = os.path.join(temp_dir, "test_image.jpg")
cv2.imwrite(img_path, dummy_img)
# Create a mock TensorFlow model
class MockTFModel(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(512 * 512 * 3, 128)
def __call__(self, img):
# Simulate TensorFlow model behavior
# Input is numpy array, output should be a mock TensorFlow tensor-like object
batch_size = img.shape[0]
flat_img = img.reshape(batch_size, -1)
output = np.random.randn(batch_size, 128).astype(np.float32)
# Return mock TensorFlow tensor with numpy() method
class MockTensor:
def __init__(self, data):
self.data = data
def numpy(self):
return self.data
return MockTensor(output)
model = MockTFModel()
ARGS = {
"filename": "test_image.jpg",
"root_dir": temp_dir,
"model": model
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- cv2, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 2, dtype family float, shape (1, 128) — shape (1, 128) 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
|
| float_to_decimal |
Ran ran on a synthesized input |
feymanpriv/DOLG/core/logging.py code served (permissive licence) · get_code("99b17e191b358f21") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import decimal
import torch
torch.manual_seed(0)
# The function converts floats to decimals recursively
# It handles dicts, floats, and other types
# Parameters: data (can be dict, float, or other), prec (int for precision)
ARGS = {
"data": {
"loss": 0.5432,
"accuracy": 0.9876,
"nested": {
"value": 0.1234,
"other": 42
}
},
"prec": 4
}
- 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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| get_logger |
Ran ran; our contract draft was wrong, not the code |
feymanpriv/DOLG/core/logging.py code served (permissive licence) · get_code("8e4e129cb77e7f8b") 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 Logger. 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 logging
ARGS = {
"name": "test_logger"
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Logger — a Logger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Logger 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_trans_fun |
Ran ran; our contract draft was wrong, not the code |
Shiro-LK/python-DOLG/dolg/resnet_pt.py code served (permissive licence) · get_code("2c4de05e1dd24c3b") 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 type. 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
from torch import nn
torch.manual_seed(0)
ARGS = {
'name': 'bottleneck_transform'
}
- 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 type — a type output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a type 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
|
| process_data |
Ran ran on a synthesized input |
Shiro-LK/python-DOLG/dolg/utils/extraction.py code served (permissive licence) · get_code("e2bad3f7809fe40b") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 3, dtype family float, shape (3, 512, 512) 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 numpy as np
import cv2
import tempfile
import os
# Create a temporary directory and a dummy image file
temp_dir = tempfile.mkdtemp()
dummy_img = np.random.randint(0, 256, (100, 100, 3), dtype=np.uint8)
dummy_filename = "test_image.jpg"
cv2.imwrite(os.path.join(temp_dir, dummy_filename), dummy_img)
ARGS = {
"filename": dummy_filename,
"root_dir": temp_dir,
"mode": "pt"
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- cv2, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 3, dtype family float, shape (3, 512, 512) — shape (3, 512, 512) 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
|
| time_string |
Ran ran; our contract draft was wrong, not the code |
feymanpriv/DOLG/core/meters.py code served (permissive licence) · get_code("803bcd86e3301891") 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 str. 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
torch.manual_seed(0)
# Looking at the time_string function:
# - It takes one parameter: seconds
# - It performs divmod operations on an integer version of seconds
# - It formats the result as a string with days, hours, minutes, seconds
ARGS = {
"seconds": 123456.789
}
- 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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str 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
|
| DOLGNet |
Not yet run unverified (harvested, no recorded run) |
innat/DOLG-TensorFlow/models/DOLG.py code served (permissive licence) · get_code("73d7a43c9d2acecd") How it ran |
| assign_globalmodel |
Not yet run unverified (harvested, no recorded run) |
Shiro-LK/python-DOLG/dolg/utils/convert_pt_to_tf2.py code served (permissive licence) · get_code("7b02caef473b8b28") How it ran |
| assign_localmodel |
Not yet run unverified (harvested, no recorded run) |
Shiro-LK/python-DOLG/dolg/utils/convert_pt_to_tf2.py code served (permissive licence) · get_code("0ca3d5ab1b980b50") How it ran |
| download_url |
Not yet run unverified (harvested, no recorded run) |
feymanpriv/DOLG/core/io.py code served (permissive licence) · get_code("e10bd0e3f25f2b57") How it ran |
| get_trans_fun |
Not yet run unverified (harvested, no recorded run) |
Shiro-LK/python-DOLG/dolg/resnet_tf2.py code served (permissive licence) · get_code("9796c11dad3f8cd9") How it ran |
| topk_errors |
Not yet run unverified (harvested, no recorded run) |
feymanpriv/DOLG/core/meters.py code served (permissive licence) · get_code("9fd6e917d49f48e4") How it ran |