SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2202.04178 · 2022

VAEL: Bridging Variational Autoencoders and Probabilistic Logic Programming

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 8 have no contract verdict; 0 failures of our instrument; 1 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/2202.04178.json · badge: /api/ran/2202.04178.svg

Each repository's role is a label: a classifier's output recorded on the link, or, where no role is recorded, what the Papers with Code archive marked. The line under it names its basis. Neither says who wrote the code.

RepositoryRoleRan
elemisi/vael canonical (classifier label)
classifier basis not recorded on the link
8 ran · 1 no recorded run
FunctionStatusWhere it lives
PNG_ResizeKeepTransparency Ran
ran on a synthesized input
elemisi/vael/utils/mario_utils/create_mario_dataset.py
code served (permissive licence) · get_code("36b03dbd2d056fd0")
How it ran

Ran 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 Image. 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.

from PIL import Image
import io

# Create a simple test PNG image with transparency
# We'll create a 100x100 RGBA image
test_image = Image.new('RGBA', (100, 100), color=(255, 0, 0, 128))

# Add some variation to make it a real image
pixels = test_image.load()
for i in range(100):
    for j in range(100):
        pixels[i, j] = (i % 256, j % 256, (i + j) % 256, 200)

ARGS = {
    'img': test_image,
    'new_width': 50,
    'new_height': 50,
    'resample': 'LANCZOS',
    'RefFile': ''
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Image — a Image output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Image output the recorded ndim 3 and dtype family int 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
define_ProbLog_model Ran
ran on a synthesized input
elemisi/vael/utils/mnist_utils/problog_model.py
code served (permissive licence) · get_code("bc47cefc5e031c93")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

# Construct valid arguments for define_ProbLog_model
facts = [
    "digit(1, 0.8).\ndigit(2, 0.2).",
    "digit(3, 0.7).\ndigit(4, 0.3).",
    "digit(5, 0.9).\ndigit(6, 0.1)."
]

rules = """
addition(X, Y) :- digit(A, _), digit(B, _), digit(C, _), X is A + B + C, Y = X.
"""

label = 42

digit_query = "digit(1, X)"

mode = 'query'

ARGS = {
    'facts': facts,
    'rules': rules,
    'label': label,
    'digit_query': digit_query,
    'mode': mode
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
define_experiment Ran
ran on a synthesized input
elemisi/vael/utils/mario_utils/mario_task_VAEL.py
code served (permissive licence) · get_code("394476b5273f33d6")
How it ran

Ran 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 os
import tempfile
from pathlib import Path
import pandas as pd

# Create a temporary directory for the experiment folder
temp_dir = tempfile.mkdtemp()
exp_folder = temp_dir
exp_class = "test_exp"

# Create the experiment class subdirectory
exp_class_dir = Path(os.path.join(exp_folder, exp_class))
exp_class_dir.mkdir(parents=True, exist_ok=True)

# Create a minimal params dict with all required keys
params = {
    'n_exp': 3,
    'rec_loss': 'mse',
    'latent_dim_sub': 16,
    'latent_dim_sym': 8,
    'learning_rate': 0.001,
    'dropout': 0.2,
    'dropout_ENC': 0.1,
    'dropout_DEC': 0.1,
    'recon_w': 1.0,
    'kl_w': 0.5,
    'query_w': 0.3,
    'sup_w': 0.2,
    'max_epoch': 100,
    'hidden_chs_MLP': 64,
    'hidden_chs_ENC': 32,
    'hidden_chs_DEC': 32,
}

# Initialize exp_counter
exp_counter = 0

ARGS = {
    'exp_folder': exp_folder,
    'exp_class': exp_class,
    'params': params,
    'exp_counter': exp_counter,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — 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
define_experiment Ran
ran on a synthesized input
elemisi/vael/utils/mnist_utils/mnist_task_VAEL.py
code served (permissive licence) · get_code("6973580d6049d0da")
How it ran

Ran 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 os
import tempfile
from pathlib import Path
import pandas as pd

# Create a temporary directory for the experiment
temp_dir = tempfile.mkdtemp()
exp_folder = temp_dir
exp_class = "test_experiment"

# Create the necessary subdirectory
exp_class_dir = os.path.join(exp_folder, exp_class)
os.makedirs(exp_class_dir, exist_ok=True)

# Define parameters dict
params = {
    'latent_dim_sub': 8,
    'latent_dim_sym': 16,
    'learning_rate': 0.001,
    'dropout': 0.2,
    'dropout_ENC': 0.1,
    'dropout_DEC': 0.15,
    'recon_w': 1.0,
    'kl_w': 0.5,
    'query_w': 0.3,
    'sup_w': 0.2,
    'n_exp': 3,
    'rec_loss': 'mse'
}

# Set up initial exp_counter
exp_counter = 0

ARGS = {
    'exp_folder': exp_folder,
    'exp_class': exp_class,
    'params': params,
    'exp_counter': exp_counter
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
pandas — 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
float_formatter Ran
ran on a synthesized input
elemisi/vael/utils/printing_utils.py
code served (permissive licence) · get_code("42a9076db8a2c341")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np

torch.manual_seed(0)

# Analyzing the function:
# - It takes a single parameter `f` which should be a float (or int, or NaN)
# - It performs checks: f != f (NaN check), isinstance(f, int), comparisons with 1000
# - It formats the float using f-string formatting
# - It does string manipulations on the result

# We need to test various cases: regular float, int, large number, NaN, small number
# The function returns a string, so we just need to pass a float

ARGS = {
    'f': 0.5
}
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 str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
load_classifier Ran
ran on a synthesized input
elemisi/vael/utils/mario_utils/mario_task_VAEL.py
code served (permissive licence) · get_code("a135b4bd171d4ae2")
How it ran

Ran 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 Sequential. 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
from torch import nn
import tempfile
import os

torch.manual_seed(0)

# Create a temporary checkpoint file with a saved model state
temp_dir = tempfile.mkdtemp()
checkpoint_path = os.path.join(temp_dir, "checkpoint.pt")

# Build the model to get its state_dict
hidden_sizes = 32
output_size = 9
clf = nn.Sequential(
    nn.Conv2d(in_channels=3, out_channels=hidden_sizes, kernel_size=5, stride=3, padding=2),
    nn.SELU(),
    nn.Dropout(p=0.5),
    nn.Conv2d(in_channels=hidden_sizes, out_channels=hidden_sizes * 2, kernel_size=5, stride=3, padding=2),
    nn.SELU(),
    nn.Dropout(p=0.5),
    nn.Conv2d(in_channels=hidden_sizes * 2, out_channels=hidden_sizes * 4, kernel_size=5, stride=3, padding=1),
    nn.SELU(),
    nn.Dropout(p=0.5),
    nn.Flatten(start_dim=1, end_dim=-1),
    nn.Linear(hidden_sizes * 4 * 4 * 4, output_size)
)

# Save the model state to checkpoint
torch.save({'model': clf.state_dict()}, checkpoint_path)

# Define device as CPU
device = torch.device('cpu')

ARGS = {
    'checkpoint_path': checkpoint_path,
    'device': device,
    'hidden_sizes': 32,
    'output_size': 9
}
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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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
load_mnist_classifier Ran
ran on a synthesized input
elemisi/vael/utils/mnist_utils/mnist_task_VAEL.py
code served (permissive licence) · get_code("6dd2d5d563ee82b0")
How it ran

Ran 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 Sequential. 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
from torch import nn
import tempfile
import os

torch.manual_seed(0)

# Create a temporary checkpoint file with a valid model state dict
temp_dir = tempfile.mkdtemp()
checkpoint_path = os.path.join(temp_dir, "model.pt")

# Create the model architecture that matches what load_mnist_classifier expects
input_size = 784
hidden_sizes = [128, 64]
output_size = 10
model = nn.Sequential(
    nn.Linear(input_size, hidden_sizes[0]),
    nn.ReLU(),
    nn.Linear(hidden_sizes[0], hidden_sizes[1]),
    nn.ReLU(),
    nn.Linear(hidden_sizes[1], output_size),
    nn.LogSoftmax(dim=1)
)

# Save the model state dict
torch.save(model.state_dict(), checkpoint_path)

# Define arguments for the function
ARGS = {
    "checkpoint_path": checkpoint_path,
    "device": torch.device("cpu")
}
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 Sequential — a Sequential output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Sequential output the recorded ndim 1 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
prettify_statistics Ran
ran on a synthesized input
elemisi/vael/utils/printing_utils.py
code served (permissive licence) · get_code("d29617a9e3891dd8")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned str. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import pandas as pd
import numpy as np

torch.manual_seed(0)

# The function 'prettify_statistics' takes a 'statistics' parameter
# which is used as: pd.DataFrame([statistics])
# This means it expects a dict-like object that can be converted to a DataFrame row

statistics = {
    'loss': 0.5432,
    'accuracy': 0.9876,
    'precision': 0.95,
    'recall': 0.92,
    'f1_score': 0.9347,
    'epoch': 10,
    'learning_rate': 0.001,
    'nan_value': float('nan'),
    'large_number': 1500.5,
    'small_number': 0.00123
}

ARGS = {
    'statistics': statistics
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type str — a str output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a str output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
resize_with_transparency Not yet run
unverified (harvested, no recorded run)
elemisi/vael/utils/mario_utils/create_mario_dataset.py
code served (permissive licence) · get_code("5e16fd1893ab2577")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 9 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

We present VAEL, a neuro-symbolic generative model integrating variational autoencoders (VAE) with the reasoning capabilities of probabilistic logic (L) programming. Besides standard latent subsymbolic variables, our model exploits a probabilistic logic program to define a further structured representation, which is used for logical reasoning. The entire process is end-to-end differentiable. Once trained, VAEL can solve new unseen generation tasks by (i) leveraging the previously acquired knowledge encoded in the neural component and (ii) exploiting new logical programs on the structured latent space. Our experiments provide support on the benefits of this neuro-symbolic integration both in terms of task generalization and data efficiency. To the best of our knowledge, this work is the first to propose a general-purpose end-to-end framework integrating probabilistic logic programming into a deep generative model.

For agents

The same record, over MCP at https://syntology.ai/mcp:

get_harvested_code_for_paper("2202.04178")
get_code_for_paper("2202.04178")
have("2202.04178")

The run record, dated, one paper per request, free:

curl https://syntology.ai/api/ran/2202.04178.json

A badge for a README (the split and the date, never a ratio):

[![Syntology run record](https://syntology.ai/api/ran/2202.04178.svg)](https://syntology.ai/paper/2202.04178)

Connect an agent — have() is free.