SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1805.11328 · 2018

Hamiltonian Variational Auto-Encoder

arXiv · PDF · Open in the Atlas

Code that ran

2 of 3 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 2 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/1805.11328.json · badge: /api/ran/1805.11328.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
anthonycaterini/hvae-nips canonical (classifier label)
classifier basis: census
2 ran · 1 no recorded run
FunctionStatusWhere it lives
evaluate Ran
ran on a synthesized input
anthonycaterini/hvae-nips/mnist/training.py
code served (permissive licence) · get_code("8f54cda60488d27a")
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 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

torch.manual_seed(0)

# Stand-in class for mnist object
class MNISTStandIn:
    def __init__(self):
        self.batches_in_test = 3
        self.batch_index = 0
    
    def next_test_batch(self):
        # Return a small batch of test data
        batch = torch.randn(2, 4)
        self.batch_index += 1
        return batch

# Stand-in class for args
class Args:
    def __init__(self):
        self.print_interval = 1

# Stand-in class for TensorFlow session
class MockSession:
    def run(self, tensors, feed_dict):
        # Return mock ELBO and NLL values
        if isinstance(tensors, tuple):
            return (0.5, 0.3)
        return 0.5

# Create mock TensorFlow placeholders/variables
class MockPlaceholder:
    pass

ARGS = {
    "mnist": MNISTStandIn(),
    "elbo": MockPlaceholder(),
    "nll": MockPlaceholder(),
    "x": MockPlaceholder(),
    "args": Args(),
    "sess": MockSession()
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 1, dtype family float — a tuple output has no array shape of its own; none is stated
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
validate Ran
ran on a synthesized input
anthonycaterini/hvae-nips/mnist/training.py
code served (permissive licence) · get_code("efc1a284ae93581a")
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 float32, ndim 0, dtype family float, shape () as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import numpy as np
import tensorflow as tf

torch.manual_seed(0)

# Stand-in MNIST object that tracks validation batches
class MockMNIST:
    def __init__(self, num_batches=3, batch_size=2, input_dim=4):
        self.batches_in_val = num_batches
        self.num_batches = num_batches
        self.batch_size = batch_size
        self.input_dim = input_dim
        self.batch_idx = 0
    
    def next_val_batch(self):
        # Return a validation batch as numpy array
        batch = np.random.randn(self.batch_size, self.input_dim).astype(np.float32)
        self.batch_idx += 1
        return batch

# Create a simple TensorFlow session and graph
tf.compat.v1.disable_eager_execution()
graph = tf.compat.v1.Graph()
with graph.as_default():
    # Create placeholder for input
    x = tf.compat.v1.placeholder(tf.float32, shape=[None, 4], name='x')
    
    # Create a simple ELBO operation (just a reduction for testing)
    elbo = tf.reduce_mean(x)

sess = tf.compat.v1.Session(graph=graph)

# Create the mock MNIST object
mnist = MockMNIST(num_batches=3, batch_size=2, input_dim=4)

ARGS = {
    'mnist': mnist,
    'elbo': elbo,
    'x': x,
    'sess': sess
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type float32, 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
train Not yet run
unverified (harvested, no recorded run)
anthonycaterini/hvae-nips/mnist/training.py
code served (permissive licence) · get_code("e44e76a7a6d6f69a")
How it ran

no invocation recorded.

Also present in other papers' code

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

Variational Auto-Encoders (VAEs) have become very popular techniques to perform inference and learning in latent variable models as they allow us to leverage the rich representational power of neural networks to obtain flexible approximations of the posterior of latent variables as well as tight evidence lower bounds (ELBOs). Combined with stochastic variational inference, this provides a methodology scaling to large datasets. However, for this methodology to be practically efficient, it is necessary to obtain low-variance unbiased estimators of the ELBO and its gradients with respect to the parameters of interest. While the use of Markov chain Monte Carlo (MCMC) techniques such as Hamiltonian Monte Carlo (HMC) has been previously suggested to achieve this [23, 26], the proposed methods require specifying reverse kernels which have a large impact on performance. Additionally, the resulting unbiased estimator of the ELBO for most MCMC kernels is typically not amenable to the reparameterization trick. We show here how to optimally select reverse kernels in this setting and, by building upon Hamiltonian Importance Sampling (HIS) [17], we obtain a scheme that provides low-variance unbiased estimators of the ELBO and its gradients using the reparameterization trick. This allows us to develop a Hamiltonian Variational Auto-Encoder (HVAE). This method can be reinterpreted as a target-informed normalizing flow [20] which, within our context, only requires a few evaluations of the gradient of the sampled likelihood and trivial Jacobian calculations at each iteration.

For agents

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

get_harvested_code_for_paper("1805.11328")
get_code_for_paper("1805.11328")
have("1805.11328")

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

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

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

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

Connect an agent — have() is free.