SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2302.09125 · 2023

JANA: Jointly Amortized Neural Approximation of Complex Bayesian Models

arXiv · PDF · Open in the Atlas

Code that ran

9 of 11 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 9 have no contract verdict; 0 failures of our instrument; 2 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/2302.09125.json · badge: /api/ran/2302.09125.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
bayesflow-org/hierarchical-model-comparison canonical (classifier label)
classifier basis not recorded on the link
5 ran · 1 no recorded run
bayesflow-org/jana-paper canonical (classifier label)
classifier basis not recorded on the link
4 ran · 1 no recorded run
FunctionStatusWhere it lives
bootstrapped_metrics Ran
ran on a synthesized input
bayesflow-org/hierarchical-model-comparison/src/python/metrics.py
code served (permissive licence) · get_code("832d36c9d536f0fd")
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, ndim 3, 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 numpy as np
import pandas as pd
from sklearn.metrics import log_loss, roc_auc_score

# Set random seed for reproducibility
np.random.seed(0)

# Create sample results DataFrames
# Each DataFrame needs: 'true_model', 'selected_model', 'm1_prob' columns
n_samples = 50

results_df_1 = pd.DataFrame({
    'true_model': np.random.randint(0, 2, n_samples),
    'selected_model': np.random.randint(0, 2, n_samples),
    'm1_prob': np.random.uniform(0, 1, n_samples)
})

results_df_2 = pd.DataFrame({
    'true_model': np.random.randint(0, 2, n_samples),
    'selected_model': np.random.randint(0, 2, n_samples),
    'm1_prob': np.random.uniform(0, 1, n_samples)
})

results_df_3 = pd.DataFrame({
    'true_model': np.random.randint(0, 2, n_samples),
    'selected_model': np.random.randint(0, 2, n_samples),
    'm1_prob': np.random.uniform(0, 1, n_samples)
})

results_list = [results_df_1, results_df_2, results_df_3]

n_bootstrap = 10
names = ['bridge_sampling', 'nn_variant_1', 'nn_variant_2']
metrics = ['accuracy', 'roc_auc', 'mae', 'rmse', 'log_score', 'bias']
model_prior = 0.45

ARGS = {
    'results_list': results_list,
    'n_bootstrap': n_bootstrap,
    'names': names,
    'metrics': metrics,
    'model_prior': model_prior
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 3, 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
compare_estimates Ran
ran on a synthesized input
bayesflow-org/jana-paper/experiments/diffusion_model/plotting_functions.py
code served (permissive licence) · get_code("793a20f4fa57a0fa")
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 Figure. 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 numpy as np
import matplotlib.pyplot as plt

# Set random seed for reproducibility
np.random.seed(0)

# Create small sample data for testing
n_data_sets = 5  # number of datasets
n_post_draws = 10  # number of posterior draws
n_params = 4  # number of parameters

# samples_x: shape (n_data_sets, n_post_draws, n_params)
samples_x = np.random.randn(n_data_sets, n_post_draws, n_params) + 1.0

# samples_y: shape (n_data_sets, n_post_draws, n_params)
samples_y = np.random.randn(n_data_sets, n_post_draws, n_params) + 1.5

# Parameter names
param_names = ['param_1', 'param_2', 'param_3', 'param_4']

ARGS = {
    'samples_x': samples_x,
    'samples_y': samples_y,
    'point_agg': np.median,
    'uncertainty_agg': np.std,
    'param_names': param_names,
    'fig_size': (12, 8),
    'label_x': 'Estimate X',
    'label_y': 'Estimate Y',
    'label_fontsize': 14,
    'title_fontsize': 16,
    'metric_fontsize': 16,
    'add_corr': True,
    'add_r2': True,
    'color': '#8f2727',
    'markersize': 6.0,
    'n_col': 2,
    'n_row': 2,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy, seaborn, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Figure — a Figure output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Figure 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
compare_point_estimates Ran
ran on a synthesized input
bayesflow-org/jana-paper/experiments/diffusion_model/plotting_functions.py
code served (permissive licence) · get_code("2889d8b7dde18304")
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 Figure. 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 numpy as np
import matplotlib
matplotlib.use('Agg')  # Use non-interactive backend

# Create sample data
np.random.seed(0)

# Create estimate arrays: (n_data_sets, n_params)
n_data_sets = 8
n_params = 3

est_x = np.random.randn(n_data_sets, n_params) * 50 + 10
est_y = est_x + np.random.randn(n_data_sets, n_params) * 5

# Create uncertainties
u_x = np.abs(np.random.randn(n_data_sets, n_params)) * 2
u_y = np.abs(np.random.randn(n_data_sets, n_params)) * 2

# Parameter names
param_names = ['param_a', 'param_b', 'param_c']

ARGS = {
    'est_x': est_x,
    'est_y': est_y,
    'u_x': u_x,
    'u_y': u_y,
    'param_names': param_names,
    'fig_size': (12, 4),
    'label_x': 'Method 1',
    'label_y': 'Method 2',
    'label_fontsize': 14,
    'title_fontsize': 16,
    'metric_fontsize': 16,
    'add_corr': True,
    'add_r2': True,
    'color': '#8f2727',
    'markersize': 6.0,
    'n_col': 3,
    'n_row': 1,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, numpy, seaborn, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Figure — a Figure output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a Figure 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
configurator Ran
ran on a synthesized input
bayesflow-org/jana-paper/experiments/diffusion_model/train_posterior.py
code served (permissive licence) · get_code("8062c3b4c7a13ce2")
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 dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

np.random.seed(0)

# Create a forward_dict with the required keys and structure
forward_dict = {
    'sim_data': np.random.randn(2, 100, 5).astype(np.float32),  # (batch_size=2, max_trials=100, features=5)
    'prior_draws': np.random.randn(2, 4).astype(np.float32),    # (batch_size=2, n_params=4)
}

ARGS = {
    'forward_dict': forward_dict,
    'min_trials': 80,
    'max_trials': 120,
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
configure_input Ran
ran on a synthesized input
bayesflow-org/jana-paper/experiments/two_moons/jana.py
code served (permissive licence) · get_code("329e64402210d50c")
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 dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

# Create sample forward_dict with the required keys
sim_data = np.random.randn(2, 4).astype(np.float32)  # batch_size=2, data_dim=4
prior_draws = np.random.randn(2, 3).astype(np.float32)  # batch_size=2, param_dim=3

forward_dict = {
    'sim_data': sim_data,
    'prior_draws': prior_draws
}

ARGS = {
    'forward_dict': forward_dict
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
performance_metrics Ran
ran on a synthesized input
bayesflow-org/hierarchical-model-comparison/src/python/metrics.py
code served (permissive licence) · get_code("14742624093d9271")
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 DataFrame. 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 numpy as np
import pandas as pd

# Create sample results DataFrames for the function
np.random.seed(0)

# Create first results DataFrame
n_samples = 100
df1 = pd.DataFrame({
    'true_model': np.random.randint(0, 2, n_samples),
    'selected_model': np.random.randint(0, 2, n_samples),
    'm1_prob': np.random.uniform(0, 1, n_samples)
})

# Create second results DataFrame with different data
df2 = pd.DataFrame({
    'true_model': np.random.randint(0, 2, n_samples),
    'selected_model': np.random.randint(0, 2, n_samples),
    'm1_prob': np.random.uniform(0, 1, n_samples)
})

# Create third results DataFrame
df3 = pd.DataFrame({
    'true_model': np.random.randint(0, 2, n_samples),
    'selected_model': np.random.randint(0, 2, n_samples),
    'm1_prob': np.random.uniform(0, 1, n_samples)
})

results_list = [df1, df2, df3]

names = ['bridge_sampling', 'nn_variant_1', 'nn_variant_2']

metrics = ['accuracy', 'roc_auc', 'mae', 'rmse', 'log_score', 'bias']

model_prior = 0.5

ARGS = {
    'results_list': results_list,
    'names': names,
    'metrics': metrics,
    'model_prior': model_prior
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas, sklearn — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataFrame — a DataFrame output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataFrame output the recorded ndim 2 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
softmax_loss Ran
ran on a synthesized input
bayesflow-org/hierarchical-model-comparison/src/python/losses.py
code served (permissive licence) · get_code("e243a18d238aa54b")
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 EagerTensor, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import tensorflow as tf
import numpy as np

# Create a simple model that outputs softmax probabilities
class SimpleModelProbabilityNetwork(tf.keras.Model):
    def __init__(self, n_models=3, input_dim=4):
        super(SimpleModelProbabilityNetwork, self).__init__()
        self.dense1 = tf.keras.layers.Dense(8, activation='relu')
        self.dense2 = tf.keras.layers.Dense(n_models, activation='softmax')
        
    def call(self, inputs):
        x = self.dense1(inputs)
        return self.dense2(x)

# Build the network
network = SimpleModelProbabilityNetwork(n_models=3, input_dim=4)

# Create model_indices: shape (batch_size=2, n_models=3)
# One-hot encoded true model indices
model_indices = tf.constant([
    [1.0, 0.0, 0.0],
    [0.0, 1.0, 0.0]
], dtype=tf.float32)

# Create sim_data: shape (batch_size=2, summary_dim=4)
# This represents synthetic data or summary statistics
sim_data = tf.constant([
    [0.1, 0.2, 0.3, 0.4],
    [0.5, 0.6, 0.7, 0.8]
], dtype=tf.float32)

ARGS = {
    'network': network,
    'model_indices': model_indices,
    'sim_data': sim_data
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 0, dtype family float, shape () — shape () as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
variable_n_obs Ran
ran on a synthesized input
bayesflow-org/hierarchical-model-comparison/src/python/helpers.py
code served (permissive licence) · get_code("edda84346a398cfd")
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 dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

ARGS = {
    'n_obs_min': 5,
    'n_obs_max': 20,
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
variable_sizes Ran
ran on a synthesized input
bayesflow-org/hierarchical-model-comparison/src/python/helpers.py
code served (permissive licence) · get_code("b0841db97e37ccfb")
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 dict. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import numpy as np

ARGS = {
    'n_clusters_min': 2,
    'n_clusters_max': 10,
    'n_obs_min': 5,
    'n_obs_max': 20,
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict output the recorded ndim 0 and dtype family float describe that coercion, not the output, and are not stated
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
configurator Not yet run
unverified (harvested, no recorded run)
bayesflow-org/jana-paper/experiments/diffusion_model/train_likelihood.py
code served (permissive licence) · get_code("b2e5291d7492d05d")
How it ran

no invocation recorded.

load_training_data Not yet run
unverified (harvested, no recorded run)
bayesflow-org/hierarchical-model-comparison/src/python/training.py
code served (permissive licence) · get_code("e3f8f9ec5b2f332f")
How it ran

no invocation recorded.

Also present in other papers' code

Of 11 samples lifted from this paper's linked repositories, 11 carry a function identity and 0 do not. Of the 11 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 11 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

This work proposes ``jointly amortized neural approximation'' (JANA) of intractable likelihood functions and posterior densities arising in Bayesian surrogate modeling and simulation-based inference. We train three complementary networks in an end-to-end fashion: 1) a summary network to compress individual data points, sets, or time series into informative embedding vectors; 2) a posterior network to learn an amortized approximate posterior; and 3) a likelihood network to learn an amortized approximate likelihood. Their interaction opens a new route to amortized marginal likelihood and posterior predictive estimation -- two important ingredients of Bayesian workflows that are often too expensive for standard methods. We benchmark the fidelity of JANA on a variety of simulation models against state-of-the-art Bayesian methods and propose a powerful and interpretable diagnostic for joint calibration. In addition, we investigate the ability of recurrent likelihood networks to emulate complex time series models without resorting to hand-crafted summary statistics.

For agents

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

get_harvested_code_for_paper("2302.09125")
get_code_for_paper("2302.09125")
have("2302.09125")

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

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

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

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

Connect an agent — have() is free.