| accuracy_fn |
Ran ran on a synthesized input |
Ducvoccer/mildnet/trainer/accuracy.py code served (permissive licence) · get_code("933a8d4076b7053d") 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)
np.random.seed(0)
# The function needs:
# - batch_size: an integer that determines how many triplets to process
# The returned accuracy function needs:
# - y_true: a tensor (not actually used in the function body)
# - y_pred: a tensor with shape (batch_size, embedding_dim) containing embeddings
# grouped in triplets (query, positive, negative)
# Create test data
batch_size = 6 # Must be divisible by 3 for triplets
embedding_dim = 4
# Create y_pred tensor with shape (batch_size, embedding_dim)
# containing 2 triplets of query, positive, negative embeddings
y_pred = tf.constant([
[0.1, 0.2, 0.3, 0.4], # query 1
[0.12, 0.22, 0.32, 0.42], # positive 1
[0.5, 0.6, 0.7, 0.8], # negative 1
[0.15, 0.25, 0.35, 0.45], # query 2
[0.17, 0.27, 0.37, 0.47], # positive 2
[0.9, 0.95, 0.85, 0.75], # negative 2
], dtype=tf.float32)
# Create y_true tensor (not used but required)
y_true = tf.constant([
[1.0, 0.0],
[1.0, 0.0],
[0.0, 1.0],
[1.0, 0.0],
[1.0, 0.0],
[0.0, 1.0],
], dtype=tf.float32)
ARGS = {
"batch_size": batch_size,
}
- 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
|
| bold_text |
Ran ran on a synthesized input |
Ducvoccer/mildnet/execute.py code served (permissive licence) · get_code("935e055e7cfb64f7") 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)
ARGS = {
'text': 'Hello World'
}
- 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
|
| get_layers_output_by_name |
Ran ran on a synthesized input |
Ducvoccer/mildnet/trainer/utils.py code served (permissive licence) · get_code("7f9ed8bff2dec4b4") 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)
class MockLayer(nn.Module):
def __init__(self, input_dim, output_dim):
super().__init__()
self.linear = nn.Linear(input_dim, output_dim)
self.output = torch.randn(2, output_dim)
def forward(self, x):
return self.linear(x)
class MockModel(nn.Module):
def __init__(self):
super().__init__()
self.layers_dict = {}
self.layer1 = MockLayer(4, 3)
self.layer2 = MockLayer(4, 5)
self.layers_dict['layer1'] = self.layer1
self.layers_dict['layer2'] = self.layer2
def get_layer(self, name):
return self.layers_dict[name]
model = MockModel()
layer_names = ['layer1', 'layer2']
ARGS = {
'model': model,
'layer_names': layer_names
}
- 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
|
| hinge_loss_fn |
Ran ran on a synthesized input |
Ducvoccer/mildnet/trainer/loss.py code served (permissive licence) · get_code("7cd865a3008326b6") 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
from tensorflow.keras import backend as K
import numpy as np
# Set seed for reproducibility
np.random.seed(0)
tf.random.set_seed(0)
# batch_size parameter: the function iterates through y_pred in steps of 3,
# so we need batch_size to be divisible by 3. Use batch_size=6.
batch_size = 6
# Create y_pred tensor: shape should be (batch_size, embedding_dim)
# The function accesses y_pred[i+0], y_pred[i+1], y_pred[i+2] (triplets)
# and computes differences and sqrt of sum of squares
# Use embedding_dim=4 as specified
embedding_dim = 4
y_pred = tf.constant(
np.random.randn(batch_size, embedding_dim).astype(np.float32),
dtype=tf.float32
)
# Create y_true tensor (not actually used in the loss function body, but required signature)
y_true = tf.constant(
np.random.randn(batch_size, embedding_dim).astype(np.float32),
dtype=tf.float32
)
ARGS = {
"batch_size": batch_size,
}
- 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
|
| hinge_new_loss_fn |
Ran ran on a synthesized input |
Ducvoccer/mildnet/trainer/loss.py code served (permissive licence) · get_code("68ff342bcecec641") 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
from tensorflow.keras import backend as K
import numpy as np
# Set seed for reproducibility
tf.random.set_seed(0)
np.random.seed(0)
# The function expects:
# - batch_size: int parameter
# - y_true: tensor (used in the inner function but not actually used in the loss calculation)
# - y_pred: tensor of shape (batch_size, embedding_dim) containing embeddings
batch_size = 6
# Create dummy y_true tensor (not used in the loss but required by the function signature)
y_true = tf.constant(np.random.randn(batch_size, 4).astype(np.float32))
# Create y_pred tensor with embeddings
# Shape: (batch_size, embedding_dim) where embedding_dim=4
# The function processes triplets: (query, positive, negative) in groups of 3
y_pred = tf.constant(np.random.randn(batch_size, 4).astype(np.float32))
ARGS = {
"batch_size": batch_size,
}
- 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
|
| hinge_twice_loss_fn |
Ran ran on a synthesized input |
Ducvoccer/mildnet/trainer/loss.py code served (permissive licence) · get_code("98ad5c847015bf7f") 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
from tensorflow.keras import backend as K
import numpy as np
_EPSILON = K.epsilon()
def hinge_twice_loss_fn(batch_size):
def hinge_twice_loss(y_true, y_pred):
y_pred = K.clip(y_pred, _EPSILON, 1.0 - _EPSILON)
loss = tf.convert_to_tensor(0, dtype=tf.float32)
g = tf.constant(1.0, shape=[1], dtype=tf.float32)
for i in range(0, batch_size, 3):
try:
q_embedding = y_pred[i + 0]
p_embedding = y_pred[i + 1]
n_embedding = y_pred[i + 2]
D_q_p = K.sqrt(K.sum((q_embedding - p_embedding) ** 2))
D_q_n = K.sqrt(K.sum((q_embedding - n_embedding) ** 2))
loss = loss + g + D_q_p - D_q_n
except:
continue
loss = loss / (batch_size / 6)
zero = tf.constant(0.0, shape=[1], dtype=tf.float32)
return tf.maximum(loss, zero)
return hinge_twice_loss
batch_size = 6
y_true_data = np.random.rand(6, 4).astype(np.float32)
y_pred_data = np.random.rand(6, 4).astype(np.float32)
y_true = tf.convert_to_tensor(y_true_data)
y_pred = tf.convert_to_tensor(y_pred_data)
loss_fn = hinge_twice_loss_fn(batch_size)
result = loss_fn(y_true, y_pred)
ARGS = {
"batch_size": 6
}
- 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
|
| random_rotation |
Ran ran on a synthesized input |
Ducvoccer/mildnet/trainer/datagen.py code served (permissive licence) · get_code("1f5d7aded9eed612") 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 3, dtype family float, shape (3, 4, 5) 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 numpy as np
import scipy.ndimage as ndi
# Set seed for reproducibility
np.random.seed(0)
# Create a small 3D numpy array (channels, height, width)
# Using distinct sizes: 3 channels, 4 height, 5 width
x = np.random.rand(3, 4, 5).astype(np.float32)
# Rotation range in degrees
rg = 15
# Row axis (height dimension)
row_axis = 1
# Column axis (width dimension)
col_axis = 2
# Channel axis
channel_axis = 0
# Fill mode for interpolation
fill_mode = 'nearest'
# Constant value for fill_mode='constant'
cval = 0.0
ARGS = {
'x': x,
'rg': rg,
'row_axis': row_axis,
'col_axis': col_axis,
'channel_axis': channel_axis,
'fill_mode': fill_mode,
'cval': cval
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 3, dtype family float, shape (3, 4, 5) — shape (3, 4, 5) 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
|
| random_shear |
Ran ran on a synthesized input |
Ducvoccer/mildnet/trainer/datagen.py code served (permissive licence) · get_code("840b01867b74e068") 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 3, dtype family float, shape (3, 4, 5) 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 numpy as np
import scipy.ndimage as ndi
# Set random seed for reproducibility
np.random.seed(0)
# Create a small 3D numpy array (channels, height, width)
# Using distinct dimensions: 3 channels, 4 height, 5 width
x = np.random.rand(3, 4, 5).astype(np.float32)
# Define arguments for random_shear function
ARGS = {
'x': x,
'intensity': 0.3,
'row_axis': 1,
'col_axis': 2,
'channel_axis': 0,
'fill_mode': 'nearest',
'cval': 0.0
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 3, dtype family float, shape (3, 4, 5) — shape (3, 4, 5) 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
|
| random_shift |
Ran ran; our contract draft was wrong, not the code |
Ducvoccer/mildnet/trainer/datagen.py code served (permissive licence) · get_code("48f4dd970a599237") 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 3, dtype family float, shape (3, 4, 5) 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 numpy as np
import scipy.ndimage as ndi
# Set random seed for reproducibility
np.random.seed(0)
# Create a small 3D image tensor (channels, height, width)
# Using distinct dimensions: 3 channels, 4 height, 5 width
x = np.random.randn(3, 4, 5).astype(np.float32)
# Define arguments for random_shift function
ARGS = {
'x': x,
'wrg': 0.1, # width shift range as fraction
'hrg': 0.2, # height shift range as fraction
'row_axis': 1, # index of height axis
'col_axis': 2, # index of width axis
'channel_axis': 0, # index of channel axis
'fill_mode': 'nearest', # fill mode for points outside boundaries
'cval': 0.0, # constant value for fill (used if fill_mode='constant')
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type ndarray, ndim 3, dtype family float, shape (3, 4, 5) — shape (3, 4, 5) 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
|
| print_trainable_counts |
Not yet run unverified (harvested, no recorded run) |
Ducvoccer/mildnet/trainer/utils.py code served (permissive licence) · get_code("6c3cb340ed94f4da") How it ran |