SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1811.11357 · 2018

Metropolis-Hastings Generative Adversarial Networks

arXiv · PDF · Open in the Atlas

Code that ran

6 of 10 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; 2 honoured the contract we drafted, 1 violated it and 1 has no contract verdict; 2 failures of our instrument; 4 no recorded run), measured 2026-11-23; 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/1811.11357.json · badge: /api/ran/1811.11357.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
uber-research/metropolis-hastings-gans canonical (classifier label)
classifier basis: classifier_2025
2 ran · 0 no recorded run
fyumoto/MHGAN community (classifier label)
classifier basis not recorded on the link
2 ran · 3 no recorded run
obryniarski/mh-gan-experiments reimplementation (classifier label)
classifier basis: classifier_2025
2 ran · 1 no recorded run
FunctionStatusWhere it lives
accept Ran
ran, violated the contract we drafted
obryniarski/mh-gan-experiments/mh.py
pointer only (licence: NONE) · get_code("d08e96add8d61822")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, obryniarski/mh-gan-experiments 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.

base Ran
ran, honoured the contract we drafted
uber-research/metropolis-hastings-gans/mhgan/demo_mhgan.py
code served (permissive licence) · get_code("58a53c24abcdac6c")
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) 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 torch.nn as nn

torch.manual_seed(0)

# The function 'base' takes two parameters: score and score_max
# Looking at the function body:
# - score is used but not actually accessed (the function just returns a fixed idx and value)
# - score_max is optional and not used in the function body
# We can pass simple numeric values or tensors

score = torch.tensor([0.5, 0.7, 0.3, 0.9])
score_max = torch.tensor([1.0, 1.0, 1.0, 1.0])

ARGS = {
    "score": score,
    "score_max": score_max
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
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
const_dict Ran
ran; our contract draft was wrong, not the code
uber-research/metropolis-hastings-gans/mhgan/demo_mhgan.py
code served (permissive licence) · get_code("abdcdecb75d17be4")
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) and returned defaultdict. 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 collections import defaultdict

torch.manual_seed(0)

def const_dict(val):
    D = defaultdict(lambda: val)
    return D

# The function takes a single parameter 'val' which can be any value
# The function creates a defaultdict that returns 'val' for any missing key
# We'll test with a simple integer value

ARGS = {
    "val": 42
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type defaultdict — a defaultdict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a defaultdict 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
gelu Ran
ran, honoured the contract we drafted
fyumoto/MHGAN/mhgan/ops.py
code served (permissive licence) · get_code("f34536b4c0da6083")
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) and returned EagerTensor, 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 tensorflow as tf
import numpy as np

# Create a small TensorFlow tensor for testing
x_value = tf.constant([[1.0, 2.0, 3.0, 4.0],
                       [0.5, 1.5, 2.5, 3.5]], dtype=tf.float32)

ARGS = {
    'x': x_value
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
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 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
gelu2 Ran
ran on a synthesized input
fyumoto/MHGAN/mhgan/ops.py
code served (permissive licence) · get_code("a9d6f3268215f9b4")
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 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 tensorflow as tf
import math

def gelu2(x):
    pi_2_sq = math.sqrt(2.0 / math.pi)
    with tf.name_scope('activation/gelu_2') as scope:
        c_t = tf.constant(0.044715, name='tanh_approx_const')
        return tf.multiply(tf.multiply(0.5, x), tf.add(1.0, tf.tanh(tf.multiply(pi_2_sq, tf.add(x, tf.multiply(c_t, tf.pow(x, 3)))))))

# Create a small tensor input
x_tensor = tf.constant([[-0.5, 0.0, 0.5, 1.0], [2.0, -1.5, 0.3, -0.2]], dtype=tf.float32)

ARGS = {
    'x': x_tensor
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, 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
torch_accept Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
obryniarski/mh-gan-experiments/mh.py
pointer only (licence: NONE) · get_code("c4bd765ec147caa3")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, obryniarski/mh-gan-experiments 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.

create_metropolis_hastings_sampler Not yet run
unverified (harvested, no recorded run)
fyumoto/MHGAN/mhgan/mhgraph.py
code served (permissive licence) · get_code("146fd5ba2efda0f1")
How it ran

no invocation recorded.

create_summary_helper Not yet run
unverified (harvested, no recorded run)
fyumoto/MHGAN/helpers.py
code served (permissive licence) · get_code("4779d176b966d262")
How it ran

no invocation recorded.

create_train_helper Not yet run
unverified (harvested, no recorded run)
fyumoto/MHGAN/helpers.py
code served (permissive licence) · get_code("cf96afe033cf5772")
How it ran

no invocation recorded.

metropolis_hastings Not yet run
unverified (harvested, no recorded run)
obryniarski/mh-gan-experiments/mh.py
pointer only (licence: NONE) · get_code("b029ee84d73a4c5a")
How it ran

The body of this sample is withheld: GitHub detected no licence in this paper's repository, obryniarski/mh-gan-experiments 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.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 1 are also present in other papers whose code we hold (1 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.

FunctionAlso present inEarliest-datedOthers named
gelu 1 other paper
1 dated earlier
1606.08415 (2016-06)
Gaussian Error Linear Units (GELUs)

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-23.

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 introduce the Metropolis-Hastings generative adversarial network (MH-GAN), which combines aspects of Markov chain Monte Carlo and GANs. The MH-GAN draws samples from the distribution implicitly defined by a GAN's discriminator-generator pair, as opposed to standard GANs which draw samples from the distribution defined only by the generator. It uses the discriminator from GAN training to build a wrapper around the generator for improved sampling. With a perfect discriminator, this wrapped generator samples from the true distribution on the data exactly even when the generator is imperfect. We demonstrate the benefits of the improved generator on multiple benchmark datasets, including CIFAR-10 and CelebA, using the DCGAN, WGAN, and progressive GAN.

For agents

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

get_harvested_code_for_paper("1811.11357")
get_code_for_paper("1811.11357")
have("1811.11357")

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

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

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

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

Connect an agent — have() is free.