| Attention |
Ran ran on a synthesized input · constructed an object; no result was computed |
hyren/query2box/codes/model.py code served (permissive licence) · get_code("2575bb19d82fba6d") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, Attention: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
ARGS = {
'mode_dims': 4,
'expand_dims': 3,
'center_use_offset': True,
'att_type': 'whole',
'bn': 'no',
'nat': 2,
'name': 'Test'
}
- 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 Attention — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Attention 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
|
| AttentionSet |
Ran ran on a synthesized input · constructed an object; no result was computed |
hyren/query2box/codes/model.py code served (permissive licence) · get_code("e519b1988ee37a5a") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, AttentionSet: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
# Define ARGS dict with all parameters for AttentionSet
ARGS = {
'mode_dims': 4,
'expand_dims': 3,
'center_use_offset': True,
'att_reg': 0.1,
'att_tem': 1.0,
'att_type': 'whole',
'bn': 'no',
'nat': 1,
'name': 'Real'
}
- 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 AttentionSet — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a AttentionSet 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
|
| BetaIntersection |
Ran ran on a synthesized input · constructed an object; no result was computed |
francoisluus/KGReasoning/models.py code served (permissive licence) · get_code("956e9a56d057daa5") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, BetaIntersection: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
# BetaIntersection expects:
# - dim: int, embedding dimension
# - use_att: bool, whether to use attention mechanism
# - forward() receives alpha_embeddings and beta_embeddings (both tensors)
# For the forward pass:
# - alpha_embeddings and beta_embeddings should have shape (num_conj, dim)
# - When use_att=True: concatenated along dim=-1, passed through Linear layers
# - When use_att=False: summed along dim=0 and divided by num_conj
ARGS = {
"dim": 4,
"use_att": 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 BetaIntersection — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BetaIntersection 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
|
| BetaProjection |
Ran ran on a synthesized input · constructed an object; no result was computed |
francoisluus/KGReasoning/models.py code served (permissive licence) · get_code("c16d861762f8696c") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, BetaProjection: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
# Define a simple projection_regularizer that takes a tensor and returns a tensor
class SimpleRegularizer(nn.Module):
def forward(self, x):
# Just return the input as-is for testing
return x
# Set up the arguments
entity_dim = 4
relation_dim = 3
hidden_dim = 5
num_layers = 2
projection_regularizer = SimpleRegularizer()
ARGS = {
'entity_dim': entity_dim,
'relation_dim': relation_dim,
'hidden_dim': hidden_dim,
'projection_regularizer': projection_regularizer,
'num_layers': num_layers,
}
- 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 BetaProjection — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BetaProjection 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
|
| BoxEstimator |
Ran ran on a synthesized input · constructed an object; no result was computed |
Jacfger/simple-stuffs/fol/estimator_box.py code served (permissive licence) · get_code("2a211e2e73b1cbde") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, BoxEstimator: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
ARGS = {
"n_entity": 10,
"n_relation": 5,
"gamma": 12.0,
"entity_dim": 4,
"relation_dim": 3,
"offset_activation": "relu",
"center_reg": 0.1,
"negative_sample_size": 2,
"device": "cpu"
}
- 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 BoxEstimator — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BoxEstimator 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
|
| BoxOffsetIntersection |
Ran ran on a synthesized input |
francoisluus/KGReasoning/models.py code served (permissive licence) · get_code("47268ecee02ceb4f") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 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
import torch.nn.functional as F
class BoxOffsetIntersection(nn.Module):
def __init__(self, dim):
super(BoxOffsetIntersection, self).__init__()
self.dim = dim
self.layer1 = nn.Linear(self.dim, self.dim)
self.layer2 = nn.Linear(self.dim, self.dim)
nn.init.xavier_uniform_(self.layer1.weight)
nn.init.xavier_uniform_(self.layer2.weight)
def forward(self, embeddings):
layer1_act = F.relu(self.layer1(embeddings))
layer1_mean = torch.mean(layer1_act, dim=0)
gate = torch.sigmoid(self.layer2(layer1_mean))
offset, _ = torch.min(embeddings, dim=0)
return offset * gate
INIT_ARGS = {
'dim': 4
}
ARGS = {
'embeddings': torch.randn(2, 4)
}
if __name__ == '__main__':
model = BoxOffsetIntersection(**INIT_ARGS)
output = model(**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
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 1, 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)
|
| BoxOffsetIntersection |
Ran ran on a synthesized input · constructed an object; no result was computed |
Jacfger/simple-stuffs/fol/estimator_box.py code served (permissive licence) · get_code("c839f4122028b419") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, BoxOffsetIntersection: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
from torch import nn
torch.manual_seed(0)
# The BoxOffsetIntersection module takes:
# - dim: an integer specifying the embedding dimension
# Looking at the forward method:
# - It expects embeddings: a tensor of shape (batch_size, dim)
# - It applies linear layers and operations that work with this shape
dim = 4
batch_size = 2
# Create a small embedding tensor for testing
embeddings = torch.randn(batch_size, dim)
ARGS = {
"dim": dim
}
- 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 BoxOffsetIntersection — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a BoxOffsetIntersection 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
|
| CenterIntersection |
Ran ran on a synthesized input · constructed an object; no result was computed |
francoisluus/KGReasoning/models.py code served (permissive licence) · get_code("a2ccec473702f3c7") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, CenterIntersection: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
# The CenterIntersection module takes embeddings as input
# The forward method expects embeddings to be a 2D tensor where:
# - It applies linear transformations
# - Uses softmax on dim=0
# - Computes weighted sum over dim=0
# So embeddings should have shape (batch_size, dim)
dim = 4
batch_size = 2
# Create sample embeddings tensor
embeddings = torch.randn(batch_size, dim)
ARGS = {
"dim": dim,
}
- 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 CenterIntersection — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a CenterIntersection 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
|
| CenterIntersection |
Ran ran on a synthesized input |
Jacfger/simple-stuffs/fol/estimator_box.py code served (permissive licence) · get_code("5c301bc69f133009") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 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
# INIT_ARGS: parameters for CenterIntersection.__init__
INIT_ARGS = {
'dim': 8
}
# ARGS: parameters for CenterIntersection.forward
# embeddings should be a 2D tensor where:
# - first dimension is the number of embeddings to intersect
# - second dimension is the embedding dimension (must match 'dim' from INIT_ARGS)
ARGS = {
'embeddings': torch.randn(5, 8) # 5 embeddings, each of dimension 8
}
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 1, 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)
|
| CenterSet |
Ran ran on a synthesized input · constructed an object; no result was computed |
hyren/query2box/codes/model.py code served (permissive licence) · get_code("e6cd914f1f66ce76") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, CenterSet: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
# Define the arguments for CenterSet
mode_dims = 4
expand_dims = 3
center_use_offset = True
agg_func = torch.min
bn = 'no'
nat = 1
name = 'Real_center'
ARGS = {
'mode_dims': mode_dims,
'expand_dims': expand_dims,
'center_use_offset': center_use_offset,
'agg_func': agg_func,
'bn': bn,
'nat': nat,
'name': name,
}
- 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 CenterSet — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a CenterSet 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
|
| Identity |
Ran ran, honoured the contract we drafted |
kjh9503/caqr/CaQR/betae/models.py pointer only (licence: NONE); the stored copy get_code serves, from akirato/perm-gaussiankg, is pointer only (licence: GPL-3.0) · get_code("f44985272d18127a") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, kjh9503/caqr when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. A run is recorded. |
| InductiveOffsetSet |
Ran ran on a synthesized input · constructed an object; no result was computed |
hyren/query2box/codes/model.py code served (permissive licence) · get_code("23039ea2b760df60") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, InductiveOffsetSet: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
# Define parameters for InductiveOffsetSet
mode_dims = 4
expand_dims = 3
offset_use_center = True
off_reg = 0.1
agg_func = torch.min
name = 'Real_offset'
# Create small tensors for forward pass
batch_size = 2
# embeds1, embeds2, embeds3: base embeddings of size [batch_size, mode_dims]
embeds1 = torch.randn(batch_size, mode_dims)
embeds2 = torch.randn(batch_size, mode_dims)
embeds3 = torch.randn(batch_size, mode_dims)
# embeds1_o, embeds2_o, embeds3_o: offset embeddings of size [batch_size, mode_dims]
embeds1_o = torch.randn(batch_size, mode_dims)
embeds2_o = torch.randn(batch_size, mode_dims)
embeds3_o = torch.randn(batch_size, mode_dims)
ARGS = {
'mode_dims': mode_dims,
'expand_dims': expand_dims,
'offset_use_center': offset_use_center,
'off_reg': off_reg,
'agg_func': agg_func,
'name': name
}
- 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 InductiveOffsetSet — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a InductiveOffsetSet 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
|
| LogicIntersection |
Ran ran on a synthesized input · constructed an object; no result was computed |
francoisluus/KGReasoning/models.py code served (permissive licence) · get_code("47248dd2646c39bd") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, LogicIntersection: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
# Build arguments for LogicIntersection
ARGS = {
'dim': 4,
'tnorm': 'mins',
'bounded': True,
'use_att': True,
'use_gtrans': 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 LogicIntersection — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LogicIntersection 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
|
| LogicProjection |
Ran ran on a synthesized input · constructed an object; no result was computed |
francoisluus/KGReasoning/models.py code served (permissive licence) · get_code("25d6c06688daacdd") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, LogicProjection: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
ARGS = {
'entity_dim': 4,
'relation_dim': 3,
'hidden_dim': 8,
'num_layers': 2,
'bounded': 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 LogicProjection — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LogicProjection 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
|
| MeanSet |
Ran ran on a synthesized input |
hyren/query2box/codes/model.py code served (permissive licence) · get_code("c14351660e82d6b2") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
# INIT_ARGS for MeanSet.__init__
INIT_ARGS = {}
# ARGS for MeanSet.forward
# The forward method expects:
# - embeds1: tensor
# - embeds1_o: tensor (not used in computation but required parameter)
# - embeds2: tensor
# - embeds2_o: tensor (not used in computation but required parameter)
# - embeds3: list or tensor (optional, default=[])
# - embeds3_o: list or tensor (optional, default=[])
# Create tensors with distinct dimensions
batch_size = 2
embed_dim = 4
embeds1 = torch.randn(batch_size, embed_dim)
embeds1_o = torch.randn(batch_size, embed_dim)
embeds2 = torch.randn(batch_size, embed_dim)
embeds2_o = torch.randn(batch_size, embed_dim)
# Test case 1: without embeds3 (will use default empty list)
ARGS = {
'embeds1': embeds1,
'embeds1_o': embeds1_o,
'embeds2': embeds2,
'embeds2_o': embeds2_o,
'embeds3': [],
'embeds3_o': []
}
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 2, 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)
|
| MinSet |
Ran ran on a synthesized input |
hyren/query2box/codes/model.py code served (permissive licence) · get_code("060a24b37fb8ba59") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, class construct-then-call prompt, model not recorded) and returned Tensor, ndim 2, dtype family float; no output shape is stated. The image it ran in was not recorded. If your copy returns the same type and ndim on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
# INIT_ARGS for MinSet.__init__()
INIT_ARGS = {}
# ARGS for MinSet.forward()
batch_size = 2
feature_dim = 4
embeds1 = torch.randn(batch_size, feature_dim)
embeds1_o = torch.randn(batch_size, feature_dim)
embeds2 = torch.randn(batch_size, feature_dim)
embeds2_o = torch.randn(batch_size, feature_dim)
embeds3 = torch.randn(batch_size, feature_dim)
embeds3_o = torch.randn(batch_size, feature_dim)
ARGS = {
'embeds1': embeds1,
'embeds1_o': embeds1_o,
'embeds2': embeds2,
'embeds2_o': embeds2_o,
'embeds3': embeds3,
'embeds3_o': embeds3_o
}
- Setup block drafted by
- a language model, class construct-then-call prompt, model not recorded
- Imports
- torch — import names as written, not package names to install; a name the repository itself provides is not a package
- Returned
- type Tensor, ndim 2, 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)
|
| OffsetSet |
Ran ran on a synthesized input · constructed an object; no result was computed |
hyren/query2box/codes/model.py code served (permissive licence) · get_code("11bb0cf115a0240f") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, OffsetSet: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
torch.manual_seed(0)
# OffsetSet parameters:
# - mode_dims: int, dimension of mode embeddings
# - expand_dims: int, dimension to expand to
# - offset_use_center: bool, whether to use center in offset
# - agg_func: callable, aggregation function (default torch.min)
# - name: str, name for parameter registration (default 'Real_offset')
mode_dims = 4
expand_dims = 3
offset_use_center = True
agg_func = torch.min
name = 'test_offset'
# Create example inputs for forward pass
batch_size = 2
# embeds1 and embeds2 are required (mode_dims dimensional)
embeds1 = torch.randn(batch_size, mode_dims)
embeds2 = torch.randn(batch_size, mode_dims)
# embeds1_o and embeds2_o are offsets (expand_dims dimensional)
embeds1_o = torch.randn(batch_size, expand_dims)
embeds2_o = torch.randn(batch_size, expand_dims)
# embeds3 and embeds3_o are optional
embeds3 = torch.randn(batch_size, mode_dims)
embeds3_o = torch.randn(batch_size, expand_dims)
ARGS = {
'mode_dims': mode_dims,
'expand_dims': expand_dims,
'offset_use_center': offset_use_center,
'agg_func': agg_func,
'name': name
}
- 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 OffsetSet — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a OffsetSet 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
|
| SizePredict |
Ran ran on a synthesized input · constructed an object; no result was computed |
francoisluus/KGReasoning/models.py code served (permissive licence) · get_code("2a2b3c074a6a00b5") How it ranRan in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned an instance of its own class, SizePredict: the run constructed the object and did not call it, so no result was computed. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.
import torch
import torch.nn as nn
import torch.nn.functional as F
class SizePredict(nn.Module):
def __init__(self, entity_dim):
super(SizePredict, self).__init__()
self.layer2 = nn.Linear(entity_dim, entity_dim // 4)
self.layer1 = nn.Linear(entity_dim // 4, entity_dim // 16)
self.layer0 = nn.Linear(entity_dim // 16, 1)
nn.init.xavier_uniform_(self.layer2.weight)
nn.init.xavier_uniform_(self.layer1.weight)
nn.init.xavier_uniform_(self.layer0.weight)
def forward(self, entropy_embedding):
x = self.layer2(entropy_embedding)
x = F.relu(x)
x = self.layer1(x)
x = F.relu(x)
x = self.layer0(x)
x = torch.sigmoid(x)
return x.squeeze()
torch.manual_seed(0)
entity_dim = 16
entropy_embedding = torch.randn(2, entity_dim)
ARGS = {
"entity_dim": entity_dim
}
- 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 SizePredict — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a SizePredict 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
|
| find_optimal_batch |
Ran ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT) |
Jacfger/simple-stuffs/fol/estimator_box.py code served (permissive licence) · get_code("d8b0a4e3912306de") 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 int, ndim 0, dtype family int, 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)
# Create tiny tensors with distinct dimensions
answer_emb = torch.randn(2, 4) # batch_size=2, embedding_dim=4
query_dist = torch.randn(3, 5) # distinct shape for query_dist
# Define a simple compute_logit function that takes batched answer embeddings and query_dist
def compute_logit(batch_answer_emb, query_dist):
# The function calls this with either:
# - batch_answer_emb.unsqueeze(0) when union=False (adds 1 dim)
# - batch_answer_emb.unsqueeze(0).unsqueeze(0) when union=True (adds 2 dims)
# So batch_answer_emb will have shape (..., 4) and we need to return a logit tensor
# This simple implementation just returns a scalar logit
return torch.tensor(1.0)
ARGS = {
"answer_emb": answer_emb,
"query_dist": query_dist,
"compute_logit": compute_logit,
"union": 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 int, ndim 0, dtype family int, 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
|
| flatten_structure |
Ran ran; our contract draft was wrong, not the code |
Blidge/KGReasoning/models.py code served (permissive licence) · get_code("d7c6b03fd8f6a3bc") 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
torch.manual_seed(0)
# The function flatten_structure recursively flattens a nested structure
# It takes query_structure as input which can be either:
# - a string (base case)
# - an iterable of nested structures (recursive case)
# Test case 1: Simple string
simple_string = "query"
# Test case 2: Nested list structure with strings
nested_structure = [
"entity",
["relation", "entity"],
[["relation", "entity"], "entity"]
]
# Test case 3: Mixed depth structure
mixed_structure = [
"start",
["middle1", "middle2"],
[["deep1", "deep2"], ["deep3", "deep4"]]
]
ARGS = {
"query_structure": nested_structure
}
- 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
|
| inclusion_sampling |
Ran ran; our contract draft was wrong, not the code |
Jacfger/simple-stuffs/fol/estimator_box.py code served (permissive licence) · get_code("c423c8497887b2c3") 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 numpy as np
import random
torch.manual_seed(0)
np.random.seed(0)
random.seed(0)
# answer_set: List[IntList] - a list of lists of integers
# Each inner list represents the set of valid answers for a particular query
answer_set = [
[0, 1, 2], # First query has answers {0, 1, 2}
[3, 4], # Second query has answers {3, 4}
]
# negative_size: int - number of negative samples to draw per query
negative_size = 5
# entity_num: int - total number of entities (upper bound for negative sampling)
entity_num = 10
# k: int - number of answers to sample from each answer set (default=1)
k = 1
# base_num: int - base number for subsampling weight calculation (default=4)
base_num = 4
ARGS = {
"answer_set": answer_set,
"negative_size": negative_size,
"entity_num": entity_num,
"k": k,
"base_num": base_num,
}
- 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 — 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
|
| order_bounds |
Ran ran; our contract draft was wrong, not the code |
francoisluus/KGReasoning/models.py code served (permissive licence) · get_code("6df8d7def6d8b856") 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 2, dtype family float, shape (2, 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
torch.manual_seed(0)
# Create a small embedding tensor
# Shape: (batch_size=2, embedding_dim=4)
# The function expects the last dimension to be split into lower and upper bounds
embedding = torch.rand(2, 4)
ARGS = {
"embedding": embedding
}
- 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 2, dtype family float, shape (2, 4) — shape (2, 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
|
| query_2p |
Ran ran; our contract draft was wrong, not the code |
Blidge/KGReasoning/models.py code served (permissive licence) · get_code("c347b52e0b2d0f36") 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 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 torch
import torch.nn as nn
from typing import Tuple
torch.manual_seed(0)
# Define a simple embedding module that stores embeddings and can be called
class SimpleEmbedding(nn.Module):
def __init__(self, num_embeddings, embedding_dim):
super().__init__()
self.weight = nn.Parameter(torch.randn(num_embeddings, embedding_dim))
def forward(self, indices):
return torch.nn.functional.embedding(indices, self.weight)
# Define entity and predicate embeddings
num_entities = 8
num_predicates = 6
embedding_dim = 4
entity_embeddings = SimpleEmbedding(num_entities, embedding_dim)
predicate_embeddings = SimpleEmbedding(num_predicates, embedding_dim)
# Define queries: shape (batch_size=2, 3) with indices
# queries[:, 0] = subject entity indices
# queries[:, 1] = first predicate indices
# queries[:, 2] = second predicate indices
queries = torch.tensor([
[0, 1, 2],
[3, 4, 5]
], dtype=torch.long)
# Define a simple scoring function that takes (s_emb, p_emb, candidates_emb) and returns scores
def scoring_function(s_emb: torch.Tensor, p_emb: torch.Tensor, candidates_emb: torch.Tensor) -> torch.Tensor:
# s_emb: (batch_size, embedding_dim)
# p_emb: (batch_size, embedding_dim)
# candidates_emb: (num_entities, embedding_dim)
# Returns: (batch_size, num_entities)
batch_size = s_emb.shape[0]
num_candidates = candidates_emb.shape[0]
# Simple scoring: dot product of (s_emb + p_emb) with each candidate
combined = s_emb + p_emb # (batch_size, embedding_dim)
scores = torch.matmul(combined, candidates_emb.t()) # (batch_size, num_entities)
return scores
# Define t_norm (triangular norm) - using minimum as a simple t-norm
def t_norm(a: torch.Tensor, b: torch.Tensor) -> torch.Tensor:
# Element-wise minimum
return torch.min(a, b)
k = 3
ARGS = {
"entity_embeddings": entity_embeddings,
"predicate_embeddings": predicate_embeddings,
"queries": queries,
"scoring_function": scoring_function,
"k": k,
"t_norm": t_norm
}
- 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 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: none by the harness; any seed is in the setup block
|
| query_3i |
Ran ran; our contract draft was wrong, not the code |
Blidge/KGReasoning/models.py code served (permissive licence) · get_code("52f5e28fee4638ab") 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 2, dtype family float, shape (2, 6) 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
from typing import Callable, Tuple, Optional
torch.manual_seed(0)
# Create entity embeddings module
class EntityEmbeddings(nn.Module):
def __init__(self, num_entities: int, embedding_dim: int):
super().__init__()
self.weight = nn.Parameter(torch.randn(num_entities, embedding_dim))
def forward(self, indices: torch.Tensor) -> torch.Tensor:
return torch.nn.functional.embedding(indices, self.weight)
# Create predicate embeddings module
class PredicateEmbeddings(nn.Module):
def __init__(self, num_predicates: int, embedding_dim: int):
super().__init__()
self.weight = nn.Parameter(torch.randn(num_predicates, embedding_dim))
def forward(self, indices: torch.Tensor) -> torch.Tensor:
return torch.nn.functional.embedding(indices, self.weight)
# Create a simple scoring function
def scoring_function(s_emb: torch.Tensor, p_emb: torch.Tensor, candidates_emb: torch.Tensor) -> torch.Tensor:
# Simple dot product scoring: (batch_size, num_candidates)
# s_emb: (batch_size, embedding_dim)
# p_emb: (batch_size, embedding_dim)
# candidates_emb: (num_candidates, embedding_dim)
combined = s_emb + p_emb # (batch_size, embedding_dim)
scores = torch.mm(combined, candidates_emb.t()) # (batch_size, num_candidates)
return scores
# Create a simple t-norm function (min operator)
def t_norm(x: torch.Tensor, y: torch.Tensor) -> torch.Tensor:
return torch.min(x, y)
# Initialize embeddings
num_entities = 6
num_predicates = 5
embedding_dim = 4
entity_embeddings = EntityEmbeddings(num_entities, embedding_dim)
predicate_embeddings = PredicateEmbeddings(num_predicates, embedding_dim)
# Create queries for query_3i
# query_3i expects queries with shape (batch_size, 6) where each pair represents (subject, predicate)
# Format: [s1, p1, s2, p2, s3, p3]
batch_size = 2
queries = torch.tensor([
[0, 0, 1, 1, 2, 2],
[3, 1, 4, 2, 5, 3]
], dtype=torch.long)
ARGS = {
"entity_embeddings": entity_embeddings,
"predicate_embeddings": predicate_embeddings,
"queries": queries,
"scoring_function": scoring_function,
"t_norm": t_norm
}
- 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 2, dtype family float, shape (2, 6) — shape (2, 6) 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
|
| query_3p |
Ran ran; our contract draft was wrong, not the code |
Blidge/KGReasoning/models.py code served (permissive licence) · get_code("805d2b1bc7c0dc90") 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 2, dtype family float, shape (2, 10) 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 embedding module
class SimpleEmbedding(nn.Module):
def __init__(self, num_embeddings, embedding_dim):
super().__init__()
self.weight = nn.Parameter(torch.randn(num_embeddings, embedding_dim))
def forward(self, indices):
return torch.nn.functional.embedding(indices, self.weight)
# Define a simple scoring function
def simple_scoring_function(s_emb, p_emb, candidates_emb):
# s_emb: [batch_size, emb_dim]
# p_emb: [batch_size, emb_dim]
# candidates_emb: [num_candidates, emb_dim]
# Output: [batch_size, num_candidates]
s_expanded = s_emb.unsqueeze(2) # [batch_size, emb_dim, 1]
p_expanded = p_emb.unsqueeze(2) # [batch_size, emb_dim, 1]
combined = s_expanded + p_expanded # [batch_size, emb_dim, 1]
scores = torch.matmul(combined.squeeze(2), candidates_emb.t()) # [batch_size, num_candidates]
return scores
# Define a simple t-norm (min operation)
def simple_t_norm(a, b):
return torch.min(a, b)
# Create instances
num_entities = 10
num_predicates = 5
embedding_dim = 4
batch_size = 2
k = 3
entity_embeddings = SimpleEmbedding(num_entities, embedding_dim)
predicate_embeddings = SimpleEmbedding(num_predicates, embedding_dim)
# Create queries: [batch_size, 4] where each row is [subject, pred1, pred2, pred3]
queries = torch.randint(0, num_entities, (batch_size, 1), dtype=torch.long)
queries = torch.cat([
queries,
torch.randint(0, num_predicates, (batch_size, 3), dtype=torch.long)
], dim=1)
ARGS = {
"entity_embeddings": entity_embeddings,
"predicate_embeddings": predicate_embeddings,
"queries": queries,
"scoring_function": simple_scoring_function,
"k": k,
"t_norm": simple_t_norm,
}
- 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 2, dtype family float, shape (2, 10) — shape (2, 10) 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
|
| query_pi |
Ran ran; our contract draft was wrong, not the code |
Blidge/KGReasoning/models.py code served (permissive licence) · get_code("51a131fbee1009cf") 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 2, dtype family float, shape (2, 10) 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
from typing import Callable
torch.manual_seed(0)
# Define entity embeddings module
class EntityEmbeddings(nn.Module):
def __init__(self, num_entities: int, embedding_dim: int):
super().__init__()
self.weight = nn.Parameter(torch.randn(num_entities, embedding_dim))
def forward(self, indices: torch.Tensor) -> torch.Tensor:
return self.weight[indices]
# Define predicate embeddings module
class PredicateEmbeddings(nn.Module):
def __init__(self, num_predicates: int, embedding_dim: int):
super().__init__()
self.weight = nn.Parameter(torch.randn(num_predicates, embedding_dim))
def forward(self, indices: torch.Tensor) -> torch.Tensor:
return self.weight[indices]
# Create embedding modules
num_entities = 10
num_predicates = 5
embedding_dim = 4
entity_embeddings = EntityEmbeddings(num_entities, embedding_dim)
predicate_embeddings = PredicateEmbeddings(num_predicates, embedding_dim)
# Define a simple scoring function
def scoring_function(s_emb: torch.Tensor, p_emb: torch.Tensor, candidates_emb: torch.Tensor) -> torch.Tensor:
# Compute scores: batch_size x num_candidates
# s_emb: (batch_size, embedding_dim)
# p_emb: (batch_size, embedding_dim)
# candidates_emb: (num_candidates, embedding_dim)
s_expanded = s_emb.unsqueeze(2) # (batch_size, embedding_dim, 1)
p_expanded = p_emb.unsqueeze(2) # (batch_size, embedding_dim, 1)
combined = s_expanded + p_expanded # (batch_size, embedding_dim, 1)
scores = torch.matmul(combined.squeeze(2), candidates_emb.t()) # (batch_size, num_candidates)
return scores
# Define a t-norm function (element-wise minimum)
def t_norm(x: torch.Tensor, y: torch.Tensor) -> torch.Tensor:
return torch.minimum(x, y)
# Create queries tensor for query_pi
# query_pi expects queries with shape (batch_size, 5):
# - queries[:, 0:3] for query_2p (subject, predicate1, predicate2)
# - queries[:, 3:5] for query_1p (subject, predicate)
batch_size = 2
queries = torch.randint(0, num_entities, (batch_size, 5))
# Make sure first column (subject) is valid
queries[:, 0] = torch.randint(0, num_entities, (batch_size,))
# Make sure predicate indices are valid
queries[:, 1] = torch.randint(0, num_predicates, (batch_size,))
queries[:, 2] = torch.randint(0, num_predicates, (batch_size,))
queries[:, 3] = torch.randint(0, num_entities, (batch_size,))
queries[:, 4] = torch.randint(0, num_predicates, (batch_size,))
k = 3
ARGS = {
'entity_embeddings': entity_embeddings,
'predicate_embeddings': predicate_embeddings,
'queries': queries,
'scoring_function': scoring_function,
'k': k,
't_norm': t_norm
}
- 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 2, dtype family float, shape (2, 10) — shape (2, 10) 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
|
| query_to_atoms |
Ran ran; our contract draft was wrong, not the code |
Blidge/KGReasoning/models.py code served (permissive licence) · get_code("bc5f262d753a9eb4") 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
torch.manual_seed(0)
# Simple query structure examples
# The function expects either a string or a nested list of strings
# Strings can be 'r' (relation), 'e' (entity), 'u' (union), 'n' (negation)
# Example: a simple query structure like [['e', 'r', 'e'], 'r', 'e']
query_structure = [['e', 'r', 'e'], 'r', 'e']
# flat_ids should be a tensor of shape (batch_size, query_length)
# where query_length matches the flattened structure length
# The flattened structure of above is: ['e', 'r', 'e', 'r', 'e'] - length 5
batch_size = 2
query_length = 5
# Create flat_ids with entity and relation IDs
# Entities: 0, 1, 2, 3...
# Relations: 100, 101, 102...
flat_ids = torch.tensor([
[0, 100, 1, 101, 2],
[3, 102, 4, 103, 5]
], dtype=torch.long)
ARGS = {
"query_structure": query_structure,
"flat_ids": flat_ids
}
- 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 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
|
| query_up_dnf |
Ran ran; our contract draft was wrong, not the code |
Blidge/KGReasoning/models.py code served (permissive licence) · get_code("02f4d333d76fc417") 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 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 torch
import torch.nn as nn
from typing import Callable, Tuple, Optional
torch.manual_seed(0)
# Define entity embeddings module
class EntityEmbeddings(nn.Module):
def __init__(self, num_entities: int, embedding_dim: int):
super().__init__()
self.weight = nn.Parameter(torch.randn(num_entities, embedding_dim))
def forward(self, indices: torch.Tensor) -> torch.Tensor:
return torch.nn.functional.embedding(indices, self.weight)
# Define predicate embeddings module
class PredicateEmbeddings(nn.Module):
def __init__(self, num_predicates: int, embedding_dim: int):
super().__init__()
self.weight = nn.Parameter(torch.randn(num_predicates, embedding_dim))
def forward(self, indices: torch.Tensor) -> torch.Tensor:
return torch.nn.functional.embedding(indices, self.weight)
# Create instances
num_entities = 8
num_predicates = 6
embedding_dim = 4
entity_embeddings = EntityEmbeddings(num_entities, embedding_dim)
predicate_embeddings = PredicateEmbeddings(num_predicates, embedding_dim)
# Create queries tensor: shape (batch_size, 6)
# Each query has 6 indices: [s1, p1, s2, p2, p_unused, p5]
batch_size = 2
queries = torch.tensor([
[0, 1, 2, 3, 4, 5],
[1, 2, 3, 4, 5, 0]
], dtype=torch.long)
# Define scoring function
def scoring_function(s_emb: torch.Tensor, p_emb: torch.Tensor, candidates_emb: torch.Tensor) -> torch.Tensor:
"""Compute scores between subject+predicate and candidates"""
batch_size = s_emb.shape[0]
num_candidates = candidates_emb.shape[0]
# Simple scoring: dot product of (s_emb + p_emb) with each candidate
s_p = s_emb + p_emb # (batch_size, embedding_dim)
scores = torch.mm(s_p, candidates_emb.t()) # (batch_size, num_candidates)
return scores
# Define t_norm function (min operation for fuzzy logic)
def t_norm(a: torch.Tensor, b: torch.Tensor) -> torch.Tensor:
return torch.minimum(a, b)
# Define t_conorm function (max operation for fuzzy logic)
def t_conorm(a: torch.Tensor, b: torch.Tensor) -> torch.Tensor:
return torch.maximum(a, b)
k = 3
ARGS = {
"entity_embeddings": entity_embeddings,
"predicate_embeddings": predicate_embeddings,
"queries": queries,
"scoring_function": scoring_function,
"k": k,
"t_norm": t_norm,
"t_conorm": t_conorm,
}
- 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 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: none by the harness; any seed is in the setup block
|
| score_candidates |
Ran ran; our contract draft was wrong, not the code |
Blidge/KGReasoning/models.py code served (permissive licence) · get_code("b97e0b8fe06b9171") 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 typing import Tuple, Optional
torch.manual_seed(0)
# Create a simple entity embedding module that takes indices and returns embeddings
class SimpleEntityEmbedding(nn.Module):
def __init__(self, num_entities: int, embedding_dim: int):
super().__init__()
self.embedding = nn.Embedding(num_entities, embedding_dim)
def forward(self, indices: torch.Tensor) -> torch.Tensor:
return self.embedding(indices)
# Create a simple scoring function
def simple_scoring_function(s_emb: torch.Tensor, p_emb: torch.Tensor, candidates_emb: torch.Tensor) -> torch.Tensor:
# s_emb: (batch_size, embedding_size)
# p_emb: (batch_size, embedding_size)
# candidates_emb: (num_candidates, embedding_size)
# Returns: (batch_size, num_candidates)
batch_size = s_emb.shape[0]
num_candidates = candidates_emb.shape[0]
# Simple scoring: dot product of (s_emb + p_emb) with each candidate
combined = s_emb + p_emb # (batch_size, embedding_size)
scores = torch.matmul(combined, candidates_emb.t()) # (batch_size, num_candidates)
return scores
# Set up parameters
batch_size = 2
embedding_size = 4
num_candidates = 7
num_entities = 10
k = 3
# Create tensors
s_emb = torch.randn(batch_size, embedding_size)
p_emb = torch.randn(batch_size, embedding_size)
candidates_emb = torch.randn(num_candidates, embedding_size)
# Create entity embeddings module
entity_embeddings = SimpleEntityEmbedding(num_entities=num_entities, embedding_dim=embedding_size)
# Build the arguments dictionary
ARGS = {
's_emb': s_emb,
'p_emb': p_emb,
'candidates_emb': candidates_emb,
'k': k,
'entity_embeddings': entity_embeddings,
'scoring_function': simple_scoring_function
}
- 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 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
|
| valclamp |
Ran ran; our contract draft was wrong, not the code |
francoisluus/KGReasoning/models.py code served (permissive licence) · get_code("51d9d0e0413cd046") 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 2, dtype family float, shape (2, 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
torch.manual_seed(0)
# Create a small tensor input
x = torch.randn(2, 4)
# Define parameters
a = 1
b = 6
lo = 0
hi = 1
# Construct ARGS dictionary with all parameters
ARGS = {
"x": x,
"a": a,
"b": b,
"lo": lo,
"hi": hi
}
- 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 2, dtype family float, shape (2, 4) — shape (2, 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
|
| AppFOQEstimator |
Not yet run unverified (harvested, no recorded run) |
Jacfger/simple-stuffs/fol/estimator_box.py code served (permissive licence) · get_code("b8322293c1e3a4ac") How it ran |
| CQD |
Not yet run unverified (harvested, no recorded run) |
Blidge/KGReasoning/models.py code served (permissive licence) · get_code("9b8c70940dfe67a9") How it ran |
| KGReasoning |
Not yet run unverified (harvested, no recorded run) |
francoisluus/KGReasoning/models.py code served (permissive licence) · get_code("87b741616782eced") How it ran |
| KGReasoning |
Not yet run unverified (harvested, no recorded run) |
Blidge/KGReasoning/models.py code served (permissive licence) · get_code("61e00b75af63ddec") How it ran |
| KGReasoning |
Not yet run unverified (harvested, no recorded run) |
LHY-24/KG-Compilation/src/models.py pointer only (licence: NONE) · get_code("823b93b900c73ef8") How it ranThe body of this sample is withheld: GitHub detected no licence in this paper's repository, LHY-24/KG-Compilation when it was checked. The setup block that called it is withheld with it, because it is written against that body. source_path and origin say where the code lives, to read under the repository's own terms. No invocation recorded. |
| N3 |
Not yet run unverified (harvested, no recorded run) |
Blidge/KGReasoning/models.py code served (permissive licence) · get_code("13dc0495d6916564") How it ran |
| Query2box |
Not yet run unverified (harvested, no recorded run) |
hyren/query2box/codes/model.py code served (permissive licence) · get_code("5cf4606d614eb571") How it ran |
| query_1p |
Not yet run unverified (harvested, no recorded run) |
Blidge/KGReasoning/models.py code served (permissive licence) · get_code("38511adc942a62d6") How it ran |
| query_2i |
Not yet run unverified (harvested, no recorded run) |
Blidge/KGReasoning/models.py code served (permissive licence) · get_code("b821d97259813ae4") How it ran |
| query_2u_dnf |
Not yet run unverified (harvested, no recorded run) |
Blidge/KGReasoning/models.py code served (permissive licence) · get_code("c5eb44c00d8b7df8") How it ran |
| query_ip |
Not yet run unverified (harvested, no recorded run) |
Blidge/KGReasoning/models.py code served (permissive licence) · get_code("2493b517068163e8") How it ran |