SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1805.07454 · 2018

Fisher Efficient Inference of Intractable Models

arXiv · PDF · Open in the Atlas

Code that ran

7 of 14 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 7 have no contract verdict; 0 failures of our instrument; 7 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/1805.07454.json · badge: /api/ran/1805.07454.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
anewgithubname/Stein-Density-Ratio-Estimation canonical (classifier label)
classifier basis: census
7 ran · 7 no recorded run
FunctionStatusWhere it lives
init_random_params Ran
ran on a synthesized input
anewgithubname/Stein-Density-Ratio-Estimation/sdre/trainnn.py
code served (permissive licence) · get_code("d2b70f16fe6e5105")
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 list. 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 autograd.numpy.random as npr

scale = 0.01
layer_sizes = [4, 5, 3, 2]
rs = npr.RandomState(0)

ARGS = {
    "scale": scale,
    "layer_sizes": layer_sizes,
    "rs": rs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
autograd — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type list — a list 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
lastlayer Ran
ran on a synthesized input
anewgithubname/Stein-Density-Ratio-Estimation/sdre/trainnn.py
code served (permissive licence) · get_code("0e6c455328751960")
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 ndarray, ndim 2, dtype family float, shape (2, 3) 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 autograd.numpy as np

# The function expects:
# - params: a list of tuples (W, b), where W and b are numpy arrays
# - inputs: a numpy array

# params should have at least 2 elements (since it checks i == len(params) - 1)
# Each tuple contains (weight_matrix, bias_vector)

# Create small weight and bias matrices
W1 = np.array([[0.1, 0.2, 0.3],
               [0.4, 0.5, 0.6],
               [0.7, 0.8, 0.9],
               [0.15, 0.25, 0.35]], dtype=np.float32)  # 4x3

b1 = np.array([0.01, 0.02, 0.03], dtype=np.float32)  # 3

W2 = np.array([[0.11, 0.21],
               [0.31, 0.41],
               [0.51, 0.61]], dtype=np.float32)  # 3x2

b2 = np.array([0.001, 0.002], dtype=np.float32)  # 2

params = [(W1, b1), (W2, b2)]

# inputs should have batch dimension matching first dimension of W1 (4)
# Actually, inputs dot W1 means inputs shape should be (batch, 4)
inputs = np.array([[1.0, 2.0, 3.0, 4.0],
                   [5.0, 6.0, 7.0, 8.0]], dtype=np.float32)  # batch=2, dim=4

ARGS = {
    "params": params,
    "inputs": inputs
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
autograd — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (2, 3) — shape (2, 3) 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
logpBar Ran
ran on a synthesized input
anewgithubname/Stein-Density-Ratio-Estimation/deprecated/demoDual.py
code served (permissive licence) · get_code("23a06012e79dd686")
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 Tensor, ndim 1, dtype family float, shape (2,) 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

torch.manual_seed(0)

d = 5
dimTheta = d

def logpBar(x, theta):
    return -sum(x ** 2 / 2 - theta * x[:dimTheta, :], 0)

# x needs to be indexable with x[:dimTheta, :], so it needs at least dimTheta rows
# theta needs to be broadcastable with x[:dimTheta, :]
# Let's create x as shape (5, 2) - 5 rows (dimTheta rows) and batch size 2
x = torch.randn(5, 2)

# theta should have the same shape as x[:dimTheta, :] which is (5, 2)
theta = torch.randn(5, 2)

ARGS = {
    "x": x,
    "theta": theta
}
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 Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) 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
logpBar Ran
ran on a synthesized input
anewgithubname/Stein-Density-Ratio-Estimation/deprecated/demoPrimal.py
code served (permissive licence) · get_code("c610ea36ee7e5fb3")
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 Tensor, ndim 1, dtype family float, shape (2,) 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

torch.manual_seed(0)

d = 5
dimTheta = d

def logpBar(x, theta):
    return -sum(x ** 2 - theta * x[:dimTheta, :], 0) / 2

# x should be a tensor of shape (d, batch_size) based on indexing x[:dimTheta, :]
# theta should be a tensor of shape (d, batch_size) or broadcastable
x = torch.randn(5, 2)  # shape (d=5, batch_size=2)
theta = torch.randn(5, 2)  # shape (d=5, batch_size=2)

ARGS = {
    "x": x,
    "theta": theta
}
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 Tensor, ndim 1, dtype family float, shape (2,) — shape (2,) 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
make_pinwheel Ran
ran on a synthesized input
anewgithubname/Stein-Density-Ratio-Estimation/sdre/data.py
code served (permissive licence) · get_code("96cfb3924a5f13a8")
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 ndarray, ndim 2, dtype family float, shape (6, 2) 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 autograd.numpy as np
import autograd.numpy.random as npr

ARGS = {
    "radial_std": 0.33,
    "tangential_std": 0.16,
    "num_classes": 3,
    "num_per_class": 2,
    "rate": 0.4,
    "rs": npr.RandomState(0),
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
autograd — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (6, 2) — shape (6, 2) 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
neural_net_predict Ran
ran on a synthesized input
anewgithubname/Stein-Density-Ratio-Estimation/sdre/trainnn.py
code served (permissive licence) · get_code("dca5c8ee2ef9364c")
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 ndarray, ndim 2, dtype family float, shape (2, 2) 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 autograd.numpy as np

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

# Create a simple neural network parameter structure
# params is a list of (weights, bias) tuples
# The function expects:
# - inputs to be an (N x D) matrix
# - Each (W, b) pair where W is (D_in x D_out) and b is (D_out,)

# Small dimensions for testing: batch_size=2, input_dim=4, hidden_dim=3, output_dim=2

# First layer: input (2x4) @ weights (4x3) + bias (3,)
W1 = np.random.randn(4, 3).astype(np.float32)
b1 = np.random.randn(3).astype(np.float32)

# Second layer: hidden (2x3) @ weights (3x2) + bias (2,)
W2 = np.random.randn(3, 2).astype(np.float32)
b2 = np.random.randn(2).astype(np.float32)

params = [(W1, b1), (W2, b2)]

# Create input: batch of 2 samples, 4 features each
inputs = np.random.randn(2, 4).astype(np.float32)

ARGS = {
    "params": params,
    "inputs": inputs,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
autograd — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ndarray, ndim 2, dtype family float, shape (2, 2) — shape (2, 2) 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
plot_images Ran
ran on a synthesized input
anewgithubname/Stein-Density-Ratio-Estimation/sdre/data.py
code served (permissive licence) · get_code("b5c03f6bf123cdfe")
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 AxesImage. 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 matplotlib.pyplot as plt
import matplotlib.image
import autograd.numpy as np

# Create a small set of images: 8 images of 28x28 pixels flattened to 784 values
np.random.seed(0)
N_images = 8
pixel_count = 28 * 28
images = np.random.rand(N_images, pixel_count).astype(np.float32)

# Create a matplotlib figure and axis
fig, ax = plt.subplots(figsize=(8, 6))

ARGS = {
    "images": images,
    "ax": ax,
    "ims_per_row": 5,
    "padding": 5,
    "digit_dimensions": (28, 28),
    "cmap": matplotlib.cm.binary,
    "vmin": None,
    "vmax": None,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
autograd, matplotlib — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type AxesImage — a AxesImage output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a AxesImage 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
NCE Not yet run
unverified (harvested, no recorded run)
anewgithubname/Stein-Density-Ratio-Estimation/script/Inference/others/demo_NCE.py
code served (permissive licence) · get_code("24e56ab709d1a455")
How it ran

no invocation recorded.

dual Not yet run
unverified (harvested, no recorded run)
anewgithubname/Stein-Density-Ratio-Estimation/sdre/estimators.py
code served (permissive licence) · get_code("571d879dad9ec295")
How it ran

no invocation recorded.

infer Not yet run
unverified (harvested, no recorded run)
anewgithubname/Stein-Density-Ratio-Estimation/script/Inference/others/demo_NCE.py
code served (permissive licence) · get_code("ebcb9454ea6b1af8")
How it ran

no invocation recorded.

kernel_gauss Not yet run
unverified (harvested, no recorded run)
anewgithubname/Stein-Density-Ratio-Estimation/sdre/helper.py
code served (permissive licence) · get_code("07679b8d805a02af")
How it ran

no invocation recorded.

kernel_poly Not yet run
unverified (harvested, no recorded run)
anewgithubname/Stein-Density-Ratio-Estimation/sdre/helper.py
code served (permissive licence) · get_code("a3a9bcea4fbca003")
How it ran

no invocation recorded.

primal Not yet run
unverified (harvested, no recorded run)
anewgithubname/Stein-Density-Ratio-Estimation/sdre/estimators.py
code served (permissive licence) · get_code("73d498b16f7d4b13")
How it ran

no invocation recorded.

traceHessF Not yet run
unverified (harvested, no recorded run)
anewgithubname/Stein-Density-Ratio-Estimation/sdre/helper.py
code served (permissive licence) · get_code("467bd3a898ce5975")
How it ran

no invocation recorded.

Also present in other papers' code

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

Maximum Likelihood Estimators (MLE) has many good properties. For example, the asymptotic variance of MLE solution attains equality of the asymptotic Cram{é}r-Rao lower bound (efficiency bound), which is the minimum possible variance for an unbiased estimator. However, obtaining such MLE solution requires calculating the likelihood function which may not be tractable due to the normalization term of the density model. In this paper, we derive a Discriminative Likelihood Estimator (DLE) from the Kullback-Leibler divergence minimization criterion implemented via density ratio estimation and a Stein operator. We study the problem of model inference using DLE. We prove its consistency and show that the asymptotic variance of its solution can attain the equality of the efficiency bound under mild regularity conditions. We also propose a dual formulation of DLE which can be easily optimized. Numerical studies validate our asymptotic theorems and we give an example where DLE successfully estimates an intractable model constructed using a pre-trained deep neural network.

For agents

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

get_harvested_code_for_paper("1805.07454")
get_code_for_paper("1805.07454")
have("1805.07454")

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

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

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

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

Connect an agent — have() is free.