| create_model |
Ran ran on a synthesized input |
lmb-freiburg/robustmvd/rmvd/models/factory.py code served (permissive licence) · get_code("58dbc50c6e14bd23") 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 MinimalModel. 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 unittest.mock import Mock, patch, MagicMock
torch.manual_seed(0)
# Create a minimal model class that satisfies the function's needs
class MinimalModel(nn.Module):
def __init__(self, pretrained=True, weights=None, train=False, num_gpus=1, **kwargs):
super().__init__()
self.pretrained = pretrained
self.weights = weights
self.num_gpus = num_gpus
self.linear = nn.Linear(4, 2)
def forward(self, x):
return self.linear(x)
# Mock the required functions that create_model depends on
def mock_has_model(name, trainable_only=False):
"""Mock function to check if model exists"""
valid_models = ['test_model', 'trainable_model']
if trainable_only:
return name in ['trainable_model']
return name in valid_models
def mock_list_models(trainable_only=False):
"""Mock function to list available models"""
if trainable_only:
return ['trainable_model']
return ['test_model', 'trainable_model']
def mock_get_model(name):
"""Mock function to get model entrypoint"""
return lambda **kwargs: MinimalModel(**kwargs)
def mock_add_run_function(model):
"""Mock function to add run function"""
model.run = Mock(return_value=None)
# Patch the module-level functions
with patch('builtins.__import__', side_effect=lambda name, *args, **kwargs: __import__(name, *args, **kwargs) if name != 'timm' else Mock()):
pass
# Set up the mocks in the namespace where create_model will look for them
import sys
current_module = sys.modules[__name__]
current_module.has_model = mock_has_model
current_module.list_models = mock_list_models
current_module._get_model = mock_get_model
current_module.add_run_function = mock_add_run_function
ARGS = {
'name': 'trainable_model',
'pretrained': False,
'weights': None,
'train': False,
'num_gpus': 1,
}
- 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 MinimalModel — a MinimalModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a MinimalModel 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_dataset_arg |
Ran ran on a synthesized input |
lmb-freiburg/robustmvd/data_viewer.py code served (permissive licence) · get_code("8b8d1839fc7d282d") 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, ndim 1, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import numpy as np
class MockArgs:
def __init__(self):
self.dataset = None
self.folder = None
self.dataset_cfg = None
# Test case 1: dataset is provided
args1 = MockArgs()
args1.dataset = "cifar10"
args1.folder = None
args1.dataset_cfg = None
# Test case 2: folder is provided
args2 = MockArgs()
args2.dataset = None
args2.folder = ["path/to/folder", "metadata.json"]
args2.dataset_cfg = None
# Test case 3: dataset_cfg is provided
args3 = MockArgs()
args3.dataset = None
args3.folder = None
args3.dataset_cfg = {"num_classes": 10, "input_dim": 784}
# Use the first valid configuration
ARGS = {
"args": args1
}
- 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 tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
- 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
|
| has_loss |
Ran ran on a synthesized input |
lmb-freiburg/robustmvd/rmvd/loss/registry.py code served (permissive licence) · get_code("988ad845f3a1efd1") 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 bool, 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
# The function has_loss checks if a name is in the _loss_entrypoints dict
# It takes one parameter: name (a string)
# The function simply does: return name in _loss_entrypoints
# We need to populate the _loss_entrypoints dict with some example entries
_loss_entrypoints = {
'mse': 'mse_loss',
'cross_entropy': 'cross_entropy_loss',
'l1': 'l1_loss'
}
# Define ARGS with the parameter 'name' set to a string that exists in _loss_entrypoints
ARGS = {
'name': 'mse'
}
- 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 bool, 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
|
| has_model |
Ran ran on a synthesized input |
lmb-freiburg/robustmvd/rmvd/models/registry.py code served (permissive licence) · get_code("0abc31be06896333") 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 bool, 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
# Initialize the global dictionaries as they would be in the actual module
_model_entrypoints = {
'resnet18': lambda: nn.Linear(10, 10),
'vit_base': lambda: nn.Linear(10, 10),
}
_trainable_model_entrypoints = {
'resnet18': lambda: nn.Linear(10, 10),
}
# Define ARGS with all parameters for has_model function
ARGS = {
'name': 'resnet18',
'trainable_only': False,
}
- 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 bool, 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
|
| list_models |
Ran ran on a synthesized input |
lmb-freiburg/robustmvd/rmvd/models/registry.py code served (permissive licence) · get_code("ccbc3fa8f40fd40d") 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 list, ndim 1, 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
# Set up the global dictionaries that list_models uses
_model_entrypoints = {
'model_a': None,
'model_b': None,
'model_c': None,
}
_trainable_model_entrypoints = {
'trainable_model_1': None,
'trainable_model_2': None,
}
# Define ARGS for the list_models function
ARGS = {
'trainable_only': False,
}
- 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 list, ndim 1, dtype family float — a list output has no array shape of its own; none is stated
- 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
|
| m_univariate_laplace_nll |
Ran ran on a synthesized input |
lmb-freiburg/robustmvd/rmvd/loss/utils.py code served (permissive licence) · get_code("1fe12ff687a6aec5") 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
torch.manual_seed(0)
# Ground truth values
gt = torch.randn(2, 4)
# Predicted mean (a parameter)
pred_a = torch.randn(2, 4)
# Predicted log scale (log_b parameter)
pred_log_b = torch.randn(2, 4)
# Mask for valid elements (optional)
mask = torch.tensor([[1.0, 1.0, 1.0, 0.0],
[1.0, 1.0, 0.0, 0.0]])
# Weight for scaling loss (optional)
weight = torch.tensor([0.5, 1.5])
ARGS = {
"gt": gt,
"pred_a": pred_a,
"pred_log_b": pred_log_b,
"mask": mask,
"weight": weight,
"eps": 1e-09
}
- 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
|
| mae |
Ran ran on a synthesized input |
lmb-freiburg/robustmvd/rmvd/loss/utils.py code served (permissive licence) · get_code("17be877e869b59a5") 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
torch.manual_seed(0)
# Create small tensors with distinct dimensions
# gt: ground truth, pred: predictions - shape (2, 4)
gt = torch.randn(2, 4)
pred = torch.randn(2, 4)
# mask: optional binary mask - shape (2, 4)
mask = torch.randint(0, 2, (2, 4))
# weight: optional weight tensor - shape (2, 1) to test unsqueeze logic
weight = torch.randn(2, 1)
# eps: small epsilon value for numerical stability
eps = 1e-09
ARGS = {
'gt': gt,
'pred': pred,
'mask': mask,
'weight': weight,
'eps': eps
}
- 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
|
| prepare_custom_model |
Ran ran on a synthesized input |
lmb-freiburg/robustmvd/rmvd/models/factory.py code served (permissive licence) · get_code("74dbbba2b390786a") 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 CustomModel. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)
# Define a minimal custom model that implements the required interface
class CustomModel(nn.Module):
def __init__(self):
super().__init__()
self.linear = nn.Linear(4, 3)
def input_adapter(self, x):
"""Adapt input to model format"""
return x
def forward(self, x):
"""Forward pass"""
return self.linear(x)
def output_adapter(self, x):
"""Adapt output from model"""
return x
# Define a stub function that will be added to the model
def add_run_function(model):
"""Stub function that the prepare_custom_model calls"""
pass
# Monkey-patch the add_run_function into the module scope
import sys
current_module = sys.modules[__name__]
setattr(current_module, 'add_run_function', add_run_function)
# Create the model instance
model = CustomModel()
# Construct the ARGS dictionary
ARGS = {
"model": model,
"train": False,
"num_gpus": 1
}
- 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 CustomModel — a CustomModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a CustomModel 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
|
| register_loss |
Ran ran on a synthesized input |
lmb-freiburg/robustmvd/rmvd/loss/registry.py code served (permissive licence) · get_code("63b07cfaf639b4f9") 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 torch.nn as nn
# Clear the loss entrypoints dictionary to start fresh
_loss_entrypoints = {}
# Create a simple loss function to register
def dummy_loss(predictions, targets):
"""A simple dummy loss function."""
return torch.mean((predictions - targets) ** 2)
# The function takes one parameter: loss_entrypoint
# It expects a callable (function) that has a __name__ attribute
# The function checks that the name isn't already registered and stores it
ARGS = {
"loss_entrypoint": dummy_loss
}
- 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 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
|
| register_model |
Ran ran on a synthesized input |
lmb-freiburg/robustmvd/rmvd/models/registry.py code served (permissive licence) · get_code("1dfeb46c44d62d62") 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 torch.nn as nn
# Reset global state for clean test
_model_entrypoints = {}
_trainable_model_entrypoints = {}
def register_model(arg=None, trainable=True):
def _register_model(model_entrypoint):
"""Register a model."""
model_name = model_entrypoint.__name__
assert model_name not in _model_entrypoints, f'Model "{model_name}" is already registered.'
_model_entrypoints[model_name] = model_entrypoint
if trainable:
_trainable_model_entrypoints[model_name] = model_entrypoint
return model_entrypoint
if callable(arg):
return _register_model(arg)
else:
return _register_model
# Create a simple test model function to use as the entrypoint
def test_model_function():
"""A simple test model entrypoint."""
return nn.Linear(10, 5)
# Test case 1: Pass a callable directly (arg is the function itself)
ARGS = {
"arg": test_model_function,
"trainable": True
}
- 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 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
|
| remove_batch_dim |
Ran ran on a synthesized input |
lmb-freiburg/robustmvd/rmvd/models/helpers.py code served (permissive licence) · get_code("34877074997c3694") 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 (4, 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 numpy as np
import collections
# Test case 1: numpy array with batch dimension
batch_array = np.random.randn(2, 4, 3)
# Test case 2: dict containing numpy arrays
batch_dict = {
'data': np.random.randn(2, 5),
'labels': np.random.randn(2, 3)
}
# Test case 3: nested dict
batch_nested_dict = {
'features': {
'x': np.random.randn(2, 4),
'y': np.random.randn(2, 3)
},
'target': np.random.randn(2, 2)
}
# Test case 4: list of arrays
batch_list = [np.random.randn(2, 4), np.random.randn(2, 3)]
# Test case 5: tuple (named tuple)
BatchTuple = collections.namedtuple('BatchTuple', ['data', 'label'])
batch_tuple = BatchTuple(
data=np.random.randn(2, 4),
label=np.random.randn(2, 3)
)
# Test case 6: None
batch_none = None
# Test case 7: regular tuple (should fail gracefully or work as sequence)
batch_regular_tuple = (np.random.randn(2, 4), np.random.randn(2, 3))
ARGS = {
'batch': batch_array
}
- Setup block drafted by
- a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
- Imports
- numpy — 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 (4, 3) — shape (4, 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
|
| create_loss |
Not yet run unverified (harvested, no recorded run) |
lmb-freiburg/robustmvd/rmvd/loss/factory.py code served (permissive licence) · get_code("4fd118b76e65dd5b") How it ran |
| pointwise_ae |
Not yet run unverified (harvested, no recorded run) |
lmb-freiburg/robustmvd/rmvd/loss/utils.py code served (permissive licence) · get_code("6300ae5e1bcfe4fe") How it ran |