| measure_acc |
Ran ran on a synthesized input |
jyanln/alignreg/src/alignreg/tf_training.py code served (permissive licence) · get_code("0f976d4063cfd225") 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 float32, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import tensorflow as tf
import tensorflow.keras as keras
import numpy as np
# Create a simple model that takes images and outputs class predictions
class SimpleModel(keras.Model):
def __init__(self):
super(SimpleModel, self).__init__()
self.dense = keras.layers.Dense(5) # 5 output classes
def call(self, inputs, training=False):
return self.dense(inputs)
# Create model instance
model = SimpleModel()
# Create small batch of images (batch_size=2, feature_dim=4)
images = tf.constant(np.random.randn(2, 4).astype(np.float32))
# Create labels (batch_size=2, with class indices 0-4)
labels = tf.constant([0, 2], dtype=tf.int64)
# Create accuracy metric
accuracy_metric = keras.metrics.Accuracy()
# Create test_data as a list of (images, labels) batches
test_data = [
(tf.constant(np.random.randn(2, 4).astype(np.float32)), tf.constant([1, 3], dtype=tf.int64)),
(tf.constant(np.random.randn(2, 4).astype(np.float32)), tf.constant([0, 4], dtype=tf.int64))
]
ARGS = {
"model": model,
"images": images,
"labels": labels,
"accuracy_metric": accuracy_metric,
"test_data": test_data
}
- 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 float32, ndim 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| measure_acc |
Ran ran on a synthesized input |
jyanln/alignreg/src/alignreg/torch_training.py code served (permissive licence) · get_code("cedf86827992a115") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned float, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
# Define a minimal model that takes images and outputs logits
class SimpleClassifier(nn.Module):
def __init__(self, num_classes=3):
super().__init__()
self.linear = nn.Linear(4, num_classes)
def forward(self, x):
# x shape: (batch_size, 4)
return self.linear(x)
# Create model instance
model = SimpleClassifier(num_classes=3)
model.eval()
# Create a simple testloader as a list of (images, labels) tuples
# Each image is a tensor of shape (batch_size, 4)
# Each label is a tensor of shape (batch_size,) with class indices
testloader = [
(torch.randn(2, 4), torch.tensor([0, 1])),
(torch.randn(2, 4), torch.tensor([2, 0])),
(torch.randn(2, 4), torch.tensor([1, 2])),
]
# num_batch parameter: -1 means use all batches
num_batch = -1
ARGS = {
"model": model,
"testloader": testloader,
"num_batch": num_batch,
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type float, ndim 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| tf_contrast |
Ran ran on a synthesized input |
jyanln/alignreg/src/alignreg/augment.py code served (permissive licence) · get_code("ec58444897d53c3d") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import tensorflow as tf
import numpy as np
# The function tf_contrast takes a parameter 'c' which is a contrast factor
# It returns a lambda that adjusts the contrast of an image
# The contrast factor is typically a float value
# Create a small test image (batch_size=2, height=4, width=3, channels=3)
# TensorFlow expects images as tensors with values typically in [0, 1] or [0, 255]
test_image = tf.constant(np.random.rand(2, 4, 3, 3).astype(np.float32))
# The contrast factor 'c' should be a float
# Values > 1 increase contrast, < 1 decrease it
contrast_factor = 1.5
ARGS = {
"c": contrast_factor
}
- 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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| tf_maxsql2 |
Ran ran on a synthesized input |
jyanln/alignreg/src/alignreg/regularization.py code served (permissive licence) · get_code("c2c0cb5c6871d8ca") 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 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import tensorflow as tf
import numpy as np
# Create a simple TensorFlow model
class SimpleModel(tf.keras.Model):
def __init__(self):
super(SimpleModel, self).__init__()
self.dense = tf.keras.layers.Dense(5)
def call(self, x, training=False):
return self.dense(x)
# Create model instance
model = SimpleModel()
# Create tiny tensors for images (batch_size=2, features=4)
images = tf.constant(np.random.randn(2, 4).astype(np.float32))
# Create augmented image sets - list of batches with augmentations applied
aug_image_sets = [
tf.constant(np.random.randn(2, 4).astype(np.float32)),
tf.constant(np.random.randn(2, 4).astype(np.float32))
]
# Create a simple loss function
def loss_fn(labels, logits):
return tf.reduce_mean(tf.keras.losses.sparse_categorical_crossentropy(labels, logits, from_logits=True))
# Create labels (batch_size=2, with class indices)
labels = tf.constant([0, 1])
# Lambda parameter for regularization
l2_lambda = 0.5
ARGS = {
"model": model,
"images": images,
"aug_image_sets": aug_image_sets,
"loss_fn": loss_fn,
"labels": labels,
"l2_lambda": l2_lambda
}
- 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 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| tf_saturation |
Ran ran on a synthesized input |
jyanln/alignreg/src/alignreg/augment.py code served (permissive licence) · get_code("7c0fd59e3ff2fb84") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import tensorflow as tf
import numpy as np
# Set seed for reproducibility
tf.random.set_seed(0)
# Create a small test image tensor
# TensorFlow image tensors are typically (height, width, channels)
# Using shape (4, 3, 3) for height=4, width=3, channels=3 (RGB)
test_image = tf.constant(np.random.rand(4, 3, 3).astype(np.float32))
# The function tf_saturation takes parameter 'c' (saturation factor)
# and returns a lambda that adjusts saturation of an image
# c is typically a float value where 1.0 is normal saturation
c_value = 1.5
ARGS = {
"c": c_value
}
- 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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| tf_sql2 |
Ran ran on a synthesized input |
jyanln/alignreg/src/alignreg/regularization.py code served (permissive licence) · get_code("12f9b449a86412ad") 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 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import tensorflow as tf
import numpy as np
# Create a minimal TensorFlow model
class SimpleModel(tf.keras.Model):
def __init__(self):
super(SimpleModel, self).__init__()
self.dense = tf.keras.layers.Dense(4)
def call(self, inputs, training=False):
return self.dense(inputs)
# Instantiate the model
model = SimpleModel()
# Create tiny tensors: batch size 2, feature dimension 3
images = tf.constant(np.random.randn(2, 3).astype(np.float32))
aug_images = tf.constant(np.random.randn(2, 3).astype(np.float32))
ARGS = {
"model": model,
"images": images,
"aug_images": aug_images
}
- 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 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| torch_rotate |
Ran ran on a synthesized input |
jyanln/alignreg/src/alignreg/augment.py code served (permissive licence) · get_code("526d47316be4a71f") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned function. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torchvision.transforms.functional as torch_transforms
from PIL import Image
import numpy as np
torch.manual_seed(0)
# Create a small PIL Image to pass to the rotate function
# torch_transforms.rotate expects a PIL Image
img_array = np.random.randint(0, 256, (4, 3, 3), dtype=np.uint8)
pil_img = Image.fromarray(img_array[0])
# The function torch_rotate(r) returns a lambda that calls torch_transforms.rotate(img, r)
# r is the rotation angle in degrees
r = 45
ARGS = {
"r": r
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| torch_sql2 |
Ran ran on a synthesized input |
jyanln/alignreg/src/alignreg/regularization.py code served (permissive licence) · get_code("43896c01fecbf540") 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 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
# Define a simple model that takes an image and returns logits
class SimpleModel(nn.Module):
def __init__(self, input_size=3, output_size=4):
super().__init__()
self.linear = nn.Linear(input_size, output_size)
def forward(self, x):
# Flatten input and pass through linear layer
batch_size = x.shape[0]
x_flat = x.view(batch_size, -1)
return self.linear(x_flat)
# Create model instance
model = SimpleModel(input_size=12, output_size=4)
# Create tiny image tensors: batch_size=2, channels=3, height=2, width=2
# Total elements per image: 2*3*2*2 = 24 -> will be flattened to 12
image = torch.randn(2, 3, 2, 2)
aug_image = torch.randn(2, 3, 2, 2)
ARGS = {
"model": model,
"image": image,
"aug_image": aug_image
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
- dtype family
- int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
- Environment
- image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
|
| torch_train |
Ran ran on a synthesized input |
jyanln/alignreg/src/alignreg/torch_training.py code served (permissive licence) · get_code("66f18a7f2b57b4a3") 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 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
from torch.optim import SGD
torch.manual_seed(0)
# Define a simple model
class SimpleModel(nn.Module):
def __init__(self):
super(SimpleModel, self).__init__()
self.fc1 = nn.Linear(4, 8)
self.fc2 = nn.Linear(8, 3)
def forward(self, x):
x = torch.relu(self.fc1(x))
x = self.fc2(x)
return x
# Create model instance
model = SimpleModel()
# Create optimizer
optimizer = SGD(model.parameters(), lr=0.01)
# Create loss function
loss_fn = nn.CrossEntropyLoss()
# Create train_loader with (images, aug_images, label) tuples
train_loader = [
(torch.randn(2, 4), torch.randn(2, 4), torch.randint(0, 3, (2,))),
(torch.randn(2, 4), torch.randn(2, 4), torch.randint(0, 3, (2,))),
]
# Create test_loader with (images, labels) tuples for measure_acc
test_loader = [
(torch.randn(2, 4), torch.randint(0, 3, (2,))),
(torch.randn(2, 4), torch.randint(0, 3, (2,))),
]
# Define a simple augmentation function
def simple_augment(x):
return x + torch.randn_like(x) * 0.1
# Define torch_maxsql2 stub function needed by torch_train
def torch_maxsql2(model, images, aug_images, loss_fn, label, l2_lambda):
return torch.tensor(0.0)
# Make it available in the module namespace
import sys
current_module = sys.modules[__name__]
setattr(current_module, 'torch_maxsql2', torch_maxsql2)
ARGS = {
'train_loader': train_loader,
'test_loader': test_loader,
'model': model,
'optimizer': optimizer,
'epochs': 2,
'loss_fn': loss_fn,
'l2_lambda': 0.01,
'record_batch_size': 1,
'acc_batch': -1,
'lazy_augmentations': [],
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- torch, tqdm — 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: none by the harness; any seed is in the setup block
|
| train_step |
Not yet run unverified (harvested, no recorded run) |
jyanln/alignreg/src/alignreg/tf_training.py code served (permissive licence) · get_code("b4c6a8550e4357bf") How it ran |