SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1807.01622 · 2018

Neural Processes

arXiv · PDF · Open in the Atlas

Code that ran

11 of 12 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 10 have no contract verdict; 1 failure 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/1807.01622.json · badge: /api/ran/1807.01622.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
jusonn/Neural-Process community (classifier label)
classifier basis not recorded on the link
6 ran · 0 no recorded run
EmilienDupont/neural-processes community (classifier label)
classifier basis not recorded on the link
4 ran · 1 no recorded run
Arnaud15/CS236_Neural_Processes_For_Image_Completion reimplementation (classifier label)
classifier basis: classifier_2025
1 ran · 0 no recorded run
FunctionStatusWhere it lives
KLD_gaussian Ran
ran on a synthesized input
jusonn/Neural-Process/np_regression.py
code served (permissive licence) · get_code("4244bd096a5b4d3e")
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

torch.manual_seed(0)

# The function takes 4 tensor parameters and performs element-wise operations
# followed by sum and scalar multiplication. All parameters should be tensors
# of the same shape.

batch_size = 2
dim = 4

mu_q = torch.randn(batch_size, dim)
std_q = torch.abs(torch.randn(batch_size, dim)) + 0.1
mu_p = torch.randn(batch_size, dim)
std_p = torch.abs(torch.randn(batch_size, dim)) + 0.1

ARGS = {
    "mu_q": mu_q,
    "std_q": std_q,
    "mu_p": mu_p,
    "std_p": std_p,
}
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
all_forward Ran
ran; our contract draft was wrong, not the code
Arnaud15/CS236_Neural_Processes_For_Image_Completion/NP.py
code served (permissive licence) · get_code("dba028b9ac289b46")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Sonnet 4.5, prompt python_fixture_v1) 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 torch
import torch.nn as nn

torch.manual_seed(0)

# Define dimensions
bsize = 2
c = 3
h = 4
w = 5
d = 8  # hidden dimension

# Create batch: (bsize, c, h, w)
batch = torch.randn(bsize, c, h, w)

# Create grid: (h, w, 2)
grid = torch.randn(h, w, 2)

# Create mask: (bsize, h, w)
mask = torch.randint(0, 2, (bsize, h, w)).float()

# Context encoder: maps (2+c) -> d
class ContextEncoder(nn.Module):
    def __init__(self, input_dim, output_dim):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, x):
        # x is (bsize, h*w, input_dim)
        return self.linear(x)

context_encoder = ContextEncoder(input_dim=2+c, output_dim=d)

# Aggregator: aggregates mask and context encodings
class Aggregator(nn.Module):
    def __init__(self):
        super().__init__()
    
    def forward(self, x, mask=None, agg_dim=1):
        # x is (bsize, h*w, d)
        # mask is (bsize, h*w, 1) or None
        if mask is not None:
            # Apply mask and aggregate
            masked_x = x * mask
            return masked_x.sum(dim=agg_dim)
        else:
            # Aggregate without mask
            return x.sum(dim=agg_dim)

aggregator = Aggregator()

# Context to distribution: maps d -> d
class ContextToDist(nn.Module):
    def __init__(self, input_dim, output_dim):
        super().__init__()
        self.linear = nn.Linear(input_dim, output_dim)
    
    def forward(self, x):
        # x is (bsize, d)
        return self.linear(x)

context_to_dist = ContextToDist(input_dim=d, output_dim=d)

ARGS = {
    'batch': batch,
    'grid': grid,
    'mask': mask,
    'context_encoder': context_encoder,
    'aggregator': aggregator,
    'context_to_dist': context_to_dist
}
Setup block drafted by
a language model, Claude Sonnet 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 — 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
celeba Ran
ran on a synthesized input
EmilienDupont/neural-processes/datasets.py
code served (permissive licence) · get_code("c64f8a677007682e")
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 DataLoader. 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
import tempfile
import os
from PIL import Image
import numpy as np

# Create a temporary directory with fake CelebA jpg files
temp_dir = tempfile.mkdtemp()
for i in range(4):
    # Create a simple RGB image (32x32)
    img_array = np.random.randint(0, 256, (32, 32, 3), dtype=np.uint8)
    img = Image.fromarray(img_array, 'RGB')
    img.save(os.path.join(temp_dir, f'img_{i}.jpg'))

ARGS = {
    'batch_size': 2,
    'size': 32,
    'crop': 28,
    'path_to_data': temp_dir,
    'shuffle': True
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
PIL, numpy, torch, torchvision — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DataLoader — a DataLoader output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a DataLoader 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
context_target_split Ran
ran on a synthesized input
EmilienDupont/neural-processes/utils.py
code served (permissive licence) · get_code("5fd036a6c28983fe")
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 torch
import numpy as np

torch.manual_seed(0)
np.random.seed(0)

# Create small tensors for x and y
# x shape: (batch_size, num_points, x_dim) = (2, 10, 4)
# y shape: (batch_size, num_points, y_dim) = (2, 10, 5)
batch_size = 2
num_points = 10
x_dim = 4
y_dim = 5

x = torch.randn(batch_size, num_points, x_dim)
y = torch.randn(batch_size, num_points, y_dim)

num_context = 4
num_extra_target = 3

ARGS = {
    "x": x,
    "y": y,
    "num_context": num_context,
    "num_extra_target": num_extra_target,
}
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 — 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
generate_grid Ran
ran on a synthesized input
jusonn/Neural-Process/np_mnist.py
code served (permissive licence) · get_code("d51da53a48566f61")
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 (1, 12, 2) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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)

ARGS = {
    'h': 4,
    'w': 3,
}
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 (1, 12, 2) — shape (1, 12, 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
get_context_idx Ran
ran on a synthesized input
jusonn/Neural-Process/np_mnist.py
code served (permissive licence) · get_code("bc1e90169bd42ed3")
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 int, shape (5,) as a later run recorded it. The image it ran in was not recorded. The code mentions cuda, and the harness aliases cuda to the CPU for every sample; whether this run needed that is 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 random

torch.manual_seed(0)
random.seed(0)

# The function get_context_idx takes one parameter N (an integer)
# It samples N indices from range(0, 784) and returns them as a tensor
# We need to provide a valid integer value for N

ARGS = {
    "N": 5
}
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 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
idx_to_y Ran
ran on a synthesized input
jusonn/Neural-Process/np_mnist.py
code served (permissive licence) · get_code("ff65d8af5d3b97d1")
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 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 torch
import torch.utils.data

torch.manual_seed(0)

# Create a small 2D tensor with distinct dimensions
# Shape: (2, 4) - 2 rows, 4 columns
data = torch.randn(2, 4)

# Create index tensor to select along dim=1
# This should have indices in range [0, 3] since dim=1 has size 4
idx = torch.tensor([0, 2, 3], dtype=torch.long)

ARGS = {
    "idx": idx,
    "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 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
img_mask_to_np_input Ran
ran on a synthesized input
EmilienDupont/neural-processes/utils.py
code served (permissive licence) · get_code("895f72cd45ff0f13")
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 torch
import torch.nn as nn

torch.manual_seed(0)

# Create a small image tensor: (batch_size=2, channels=3, height=4, width=5)
img = torch.rand(2, 3, 4, 5)

# Create a binary mask tensor: (batch_size=2, height=4, width=5)
# Each mask must have the same number of unmasked pixels
# Let's say we unmask 6 pixels per image in the batch
mask = torch.zeros(2, 4, 5, dtype=torch.uint8)
# Set 6 pixels to 1 (unmasked) for first image
mask[0, 0, 0] = 1
mask[0, 0, 1] = 1
mask[0, 1, 2] = 1
mask[0, 2, 1] = 1
mask[0, 3, 0] = 1
mask[0, 3, 3] = 1
# Set the same 6 pixels to 1 (unmasked) for second image
mask[1, 0, 0] = 1
mask[1, 0, 1] = 1
mask[1, 1, 2] = 1
mask[1, 2, 1] = 1
mask[1, 3, 0] = 1
mask[1, 3, 3] = 1

normalize = True

ARGS = {
    "img": img,
    "mask": mask,
    "normalize": normalize,
}
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 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
log_likelihood Ran
ran on a synthesized input
jusonn/Neural-Process/np_regression.py
code served (permissive licence) · get_code("aa12408acd63ec57")
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

torch.manual_seed(0)

# Create small tensors with distinct dimensions
# mu: mean of the normal distribution
mu = torch.randn(2, 4)

# std: standard deviation of the normal distribution
std = torch.abs(torch.randn(2, 4)) + 0.1  # ensure positive

# target: values to compute log probability for
target = torch.randn(2, 4)

ARGS = {
    "mu": mu,
    "std": std,
    "target": target,
}
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
random_context_target_mask Ran
ran on a synthesized input
EmilienDupont/neural-processes/utils.py
code served (permissive licence) · get_code("e912b4a390c2e8fc")
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 int; 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 torch

torch.manual_seed(0)
np.random.seed(0)

ARGS = {
    "img_size": (3, 8, 8),
    "num_context": 5,
    "num_extra_target": 3,
}
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 3, dtype family int — 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
random_split_c_t Ran
ran on a synthesized input
jusonn/Neural-Process/np_regression.py
code served (permissive licence) · get_code("78e067a8184547c2")
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 numpy as np

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

# Create small sample data
# x: shape (6, 4) - 6 samples, 4 features
# y: shape (6, 3) - 6 samples, 3 targets
x = np.random.randn(6, 4).astype(np.float32)
y = np.random.randn(6, 3).astype(np.float32)

# Number of context samples
n_context = 2

ARGS = {
    'x': x,
    'y': y,
    'n_context': n_context
}
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 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
mnist Not yet run
unverified (harvested, no recorded run)
EmilienDupont/neural-processes/datasets.py
code served (permissive licence) · get_code("6e22049190dc8b13")
How it ran

no invocation recorded.

Also present in other papers' code

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

FunctionAlso present inEarliest-datedOthers named
all_forward 1 other paper
1 the same month
1807.01613 (2018-07)
Conditional Neural Processes

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

A neural network (NN) is a parameterised function that can be tuned via gradient descent to approximate a labelled collection of data with high precision. A Gaussian process (GP), on the other hand, is a probabilistic model that defines a distribution over possible functions, and is updated in light of data via the rules of probabilistic inference. GPs are probabilistic, data-efficient and flexible, however they are also computationally intensive and thus limited in their applicability. We introduce a class of neural latent variable models which we call Neural Processes (NPs), combining the best of both worlds. Like GPs, NPs define distributions over functions, are capable of rapid adaptation to new observations, and can estimate the uncertainty in their predictions. Like NNs, NPs are computationally efficient during training and evaluation but also learn to adapt their priors to data. We demonstrate the performance of NPs on a range of learning tasks, including regression and optimisation, and compare and contrast with related models in the literature.

For agents

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

get_harvested_code_for_paper("1807.01622")
get_code_for_paper("1807.01622")
have("1807.01622")

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

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

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

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

Connect an agent — have() is free.