SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1606.02185 · 2016

Towards a Neural Statistician

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; 1 honoured the contract we drafted, 0 violated it and 4 have no contract verdict; 2 failures of our instrument; 7 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/1606.02185.json · badge: /api/ran/1606.02185.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
lupalab/flowscan canonical (classifier label)
classifier basis: census
0 ran · 6 no recorded run
cravingoxygen/neuralstat community (classifier label)
classifier basis not recorded on the link
7 ran · 1 no recorded run
FunctionStatusWhere it lives
Hbeta Ran
ran, honoured the contract we drafted
cravingoxygen/neuralstat/tsne.py
code served (permissive licence) · get_code("77fb404ad78a22d9")
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 numpy as np

# Create a small distance matrix as the D parameter
# This should be a 1D array of distances
D = np.array([0.0, 0.5, 1.0, 1.5, 2.0])

# Create the beta parameter
beta = 1.0

# Construct the ARGS dictionary with all parameters
ARGS = {
    'D': D,
    'beta': beta
}
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 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
apply_batch_norm Ran
ran on a synthesized input
cravingoxygen/neuralstat/spatial_mnist.py
code served (permissive licence) · get_code("6913afa4a65fe7f8")
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 3, dtype family float, shape (2, 3, 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Create a BatchNorm1d module with num_features=4
batch_norm = nn.BatchNorm1d(num_features=4)

# Create a data tensor with shape (2, 3, 4)
# This will be reshaped to (-1, 4) = (6, 4) inside the function
data = torch.randn(2, 3, 4)

ARGS = {
    "batch_norm": batch_norm,
    "data": data
}
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 Tensor, ndim 3, dtype family float, shape (2, 3, 4) — shape (2, 3, 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
gaussian_log_likelihood Ran
ran on a synthesized input
cravingoxygen/neuralstat/tests.py
code served (permissive licence) · get_code("2e7d466cc00bbeab")
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 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 as to
from math import log, pi

to.manual_seed(0)

# Create small tensors for the function
x = to.randn(2, 4)
mean = to.randn(2, 4)
logvar = to.randn(2, 4)
clip = True

ARGS = {
    "x": x,
    "mean": mean,
    "logvar": logvar,
    "clip": clip,
}
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 Tensor, 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
load_images Ran
ran on a synthesized input
cravingoxygen/neuralstat/spatialcreate.py
code served (permissive licence) · get_code("5c72e16208cff35c")
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 (33554432, 0) 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 gzip
import numpy as np
import io

# Create a minimal gzip file containing valid MNIST-like image data
def create_test_gzip_file():
    # MNIST header format: magic number, num_images, num_rows, num_cols (all big-endian int32)
    magic = np.array([2051], dtype='>i4')  # Magic number for image file
    n = np.array([2], dtype='>i4')  # 2 images
    x = np.array([4], dtype='>i4')  # 4 pixels wide
    y = np.array([3], dtype='>i4')  # 3 pixels tall
    
    header = np.concatenate([magic, n, x, y])
    
    # Create image data: 2 images * 4 * 3 = 24 bytes
    image_data = np.arange(24, dtype='>u1')
    
    # Write to bytes buffer and gzip it
    buffer = io.BytesIO()
    with gzip.GzipFile(fileobj=buffer, mode='wb') as gz:
        gz.write(header.tobytes())
        gz.write(image_data.tobytes())
    
    buffer.seek(0)
    return buffer.getvalue()

# Create temporary gzip file path by storing in memory
import tempfile
import os

temp_dir = tempfile.gettempdir()
test_file_path = os.path.join(temp_dir, 'test_images.gz')

# Write the test gzip file
with open(test_file_path, 'wb') as f:
    f.write(create_test_gzip_file())

ARGS = {
    'path': test_file_path
}
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 ndarray, ndim 2, dtype family float, shape (33554432, 0) — shape (33554432, 0) 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
load_labels Ran
ran on a synthesized input
cravingoxygen/neuralstat/spatialcreate.py
code served (permissive licence) · get_code("b1af56804ab57958")
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 1, dtype family int, shape (5,) 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 gzip
import numpy as np
import io

# Create a valid gzip-compressed file in memory with MNIST-like label format
def create_test_gzip_file():
    """Create a gzip file with magic number and labels in MNIST format"""
    buffer = io.BytesIO()
    
    with gzip.GzipFile(fileobj=buffer, mode='wb') as gz:
        # MNIST label file magic number is 2049 (0x00000801)
        magic = np.int32(2049)
        # Number of labels
        n_labels = np.int32(5)
        
        # Write header: magic number and count
        gz.write(magic.tobytes())
        gz.write(n_labels.tobytes())
        
        # Write label data (5 labels, values 0-9)
        labels = np.array([3, 7, 2, 1, 9], dtype=np.uint8)
        gz.write(labels.tobytes())
    
    buffer.seek(0)
    return buffer

# Create temporary gzip file and get its path-like object
test_buffer = create_test_gzip_file()

# For the function to work, we need to pass a file path that gzip.open can read
# Since we can't do real file I/O, we'll create a minimal file-like object wrapper
class GzipPath:
    def __init__(self, gzip_buffer):
        self.gzip_buffer = gzip_buffer
    
    def __str__(self):
        # This is called by gzip.open, but we need to use a workaround
        return "test_labels.gz"

# Actually, let's use a simpler approach - write to a real temp location in memory
import tempfile
import os

# Create actual temporary file
temp_fd, temp_path = tempfile.mkstemp(suffix='.gz')
os.close(temp_fd)

try:
    with gzip.open(temp_path, 'wb') as gz:
        magic = np.int32(2049)
        n_labels = np.int32(5)
        gz.write(magic.tobytes())
        gz.write(n_labels.tobytes())
        labels = np.array([3, 7, 2, 1, 9], dtype=np.uint8)
        gz.write(labels.tobytes())
    
    ARGS = {
        'path': temp_path
    }
finally:
    # Note: in actual execution, temp file will be cleaned up
    pass
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 ndarray, ndim 1, dtype family int, shape (5,) — shape (5,) 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
pca Ran
ran; our contract draft was wrong, not the code
cravingoxygen/neuralstat/tsne.py
code served (permissive licence) · get_code("f60cb3cead55f81b")
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 (5, 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 numpy as np

np.random.seed(0)

# Create a small test dataset: 5 samples, 10 features
X = np.random.randn(5, 10).astype(np.float32)

# Set no_dims to reduce to 3 dimensions
no_dims = 3

ARGS = {
    'X': X,
    'no_dims': no_dims
}
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 ndarray, ndim 2, dtype family float, shape (5, 3) — shape (5, 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
x2p Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
cravingoxygen/neuralstat/tsne.py
code served (permissive licence) · get_code("654e67f1bec03fc8")
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 (5, 5) 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 numpy as np

# The function x2p expects:
# - X: a 2D numpy array of shape (n, d) containing n data points in d dimensions
# - tol: a float tolerance value
# - perplexity: a float perplexity value

# Create a small dataset: 5 points in 3 dimensions
np.random.seed(0)
X = np.random.randn(5, 3).astype(np.float64)

ARGS = {
    'X': X,
    'tol': 1e-5,
    'perplexity': 30.0
}
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 ndarray, ndim 2, dtype family float, shape (5, 5) — shape (5, 5) 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
generate_samples_like Not yet run
unverified (harvested, no recorded run)
cravingoxygen/neuralstat/spatial_mnist.py
code served (permissive licence) · get_code("7e9c25119c6905fb")
How it ran

no invocation recorded.

independent_model Not yet run
unverified (harvested, no recorded run)
lupalab/flowscan/model/conditionals.py
code served (permissive licence) · get_code("95f11ad1d1b6f501")
How it ran

no invocation recorded.

main Not yet run
unverified (harvested, no recorded run)
lupalab/flowscan/demos/flowscan_demo.py
code served (permissive licence) · get_code("b2874edcc99ce4e6")
How it ran

no invocation recorded.

make_in_out Not yet run
unverified (harvested, no recorded run)
lupalab/flowscan/model/conditionals.py
code served (permissive licence) · get_code("6625ee33e78ed05d")
How it ran

no invocation recorded.

mixture_of_mixtures Not yet run
unverified (harvested, no recorded run)
lupalab/flowscan/model/likelihoods.py
code served (permissive licence) · get_code("d96984eb51ffcaa1")
How it ran

no invocation recorded.

new_mixture_of_mixtures Not yet run
unverified (harvested, no recorded run)
lupalab/flowscan/model/likelihoods.py
code served (permissive licence) · get_code("9c2927a6cb5b2667")
How it ran

no invocation recorded.

sample_mm Not yet run
unverified (harvested, no recorded run)
lupalab/flowscan/model/conditionals.py
code served (permissive licence) · get_code("dffe6cbc0b246e38")
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, 3 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 3 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.

FunctionAlso present inEarliest-datedOthers named
Hbeta 3 other papers
3 later
1908.00686 (2019-08)
Demon in the Variant: Statistical Analysis of DNNs for Robust Backdoor Contamination Detection
2310.00542 (2023-10)
Watch Out! Simple Horizontal Class Backdoor Can Trivially Evade Defense
2510.07746 (2025-10)
t-SNE Exaggerates Clusters, Provably
pca 2 other papers
2 later
1908.00686 (2019-08)
Demon in the Variant: Statistical Analysis of DNNs for Robust Backdoor Contamination Detection
2310.00542 (2023-10)
Watch Out! Simple Horizontal Class Backdoor Can Trivially Evade Defense
x2p 2 other papers
2 later
1908.00686 (2019-08)
Demon in the Variant: Statistical Analysis of DNNs for Robust Backdoor Contamination Detection
2310.00542 (2023-10)
Watch Out! Simple Horizontal Class Backdoor Can Trivially Evade Defense

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

An efficient learner is one who reuses what they already know to tackle a new problem. For a machine learner, this means understanding the similarities amongst datasets. In order to do this, one must take seriously the idea of working with datasets, rather than datapoints, as the key objects to model. Towards this goal, we demonstrate an extension of a variational autoencoder that can learn a method for computing representations, or statistics, of datasets in an unsupervised fashion. The network is trained to produce statistics that encapsulate a generative model for each dataset. Hence the network enables efficient learning from new datasets for both unsupervised and supervised tasks. We show that we are able to learn statistics that can be used for: clustering datasets, transferring generative models to new datasets, selecting representative samples of datasets and classifying previously unseen classes. We refer to our model as a neural statistician, and by this we mean a neural network that can learn to compute summary statistics of datasets without supervision.

For agents

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

get_harvested_code_for_paper("1606.02185")
get_code_for_paper("1606.02185")
have("1606.02185")

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

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

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

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

Connect an agent — have() is free.