SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2302.11002 · ICML · 2023

Learning Physical Models that Can Respect Conservation Laws

Michael Mahoney, Danielle Maddix, Derek Hansen, Gaurav Gupta, Shima Alizadeh

arXiv · PDF · Open in the Atlas

Code that ran

10 of 14 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (5 of them constructed an object rather than computing a result; 1 honoured the contract we drafted, 0 violated it and 5 have no contract verdict; 4 failures of our instrument; 4 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/2302.11002.json · badge: /api/ran/2302.11002.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
amazon-science/probconserv canonical (classifier label)
classifier basis: classifier_2025
10 ran · 4 no recorded run
FunctionStatusWhere it lives
Attention Ran
ran on a synthesized input · constructed an object; no result was computed
amazon-science/probconserv/deep_pdes/attentive_neural_process/probconserv.py
code served (permissive licence) · get_code("bf3079228b4b66f8")
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 an instance of its own class, Attention: the run constructed the object and did not call it, so no result was computed. 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
from torch import Tensor

torch.manual_seed(0)

# Define the required components
class Linear(nn.Module):
    def __init__(self, in_dim, out_dim, bias=True, w_init='linear'):
        super().__init__()
        self.linear_layer = nn.Linear(in_dim, out_dim, bias=bias)
        nn.init.xavier_uniform_(self.linear_layer.weight, gain=nn.init.calculate_gain(w_init))

    def forward(self, x):
        return self.linear_layer(x)

class MultiheadAttention(nn.Module):
    def __init__(self, num_hidden_k):
        super().__init__()
        self.num_hidden_k = num_hidden_k
        self.attn_dropout = nn.Dropout(p=0.1)

    def forward(self, key, value, query):
        attn = torch.bmm(query, key.transpose(1, 2))
        attn = attn / (self.num_hidden_k ** 0.5)
        attn = torch.softmax(attn, dim=-1)
        attn = self.attn_dropout(attn)
        output = torch.bmm(attn, value)
        return (output, attn)

class Attention(nn.Module):
    def __init__(self, num_hidden, n_heads=4):
        super().__init__()
        self.num_hidden = num_hidden
        self.num_hidden_per_attn = num_hidden // n_heads
        self.n_heads = n_heads
        self.encoder_key = Linear(num_hidden, num_hidden, bias=False)
        self.encoder_value = Linear(num_hidden, num_hidden, bias=False)
        self.encoder_query = Linear(num_hidden, num_hidden, bias=False)
        self.multihead = MultiheadAttention(self.num_hidden_per_attn)
        self.residual_dropout = nn.Dropout(p=0.1)
        self.final_linear = Linear(num_hidden * 2, num_hidden)
        self.layer_norm = nn.LayerNorm(num_hidden)

    def forward(self, key, value, query):
        from einops import rearrange
        pattern = 'b n (nh nhpa) -> (nh b) n nhpa'
        key_enc = rearrange(self.encoder_key(key), pattern, nh=self.n_heads)
        value_enc = rearrange(self.encoder_value(value), pattern, nh=self.n_heads)
        query_enc = rearrange(self.encoder_query(query), pattern, nh=self.n_heads)
        output, attns = self.multihead(key_enc, value_enc, query_enc)
        output = rearrange(output, '(nh b) sq nhpa -> b sq (nh nhpa)', nh=self.n_heads)
        output = torch.cat([query, output], dim=-1)
        output = self.final_linear(output)
        output = self.residual_dropout(output)
        output += query
        output = self.layer_norm(output)
        return (output, attns)

# Create arguments for Attention
# num_hidden must be divisible by n_heads for the forward pass to work
num_hidden = 8
n_heads = 4

# Create the Attention module
attention_module = Attention(num_hidden=num_hidden, n_heads=n_heads)

# Create input tensors
# Shape: (batch_size, sequence_length, num_hidden)
batch_size = 2
seq_length = 3

key = torch.randn(batch_size, seq_length, num_hidden)
value = torch.randn(batch_size, seq_length, num_hidden)
query = torch.randn(batch_size, seq_length, num_hidden)

# Define ARGS dict for the Attention.__init__ parameters
ARGS = {
    'num_hidden': num_hidden,
    'n_heads': n_heads,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Attention — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Attention 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
DeterministicEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
amazon-science/probconserv/deep_pdes/attentive_neural_process/probconserv.py
code served (permissive licence) · get_code("5db7fd66cc15d4fe")
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 an instance of its own class, DeterministicEncoder: the run constructed the object and did not call it, so no result was computed. 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
from torch import Tensor

torch.manual_seed(0)

# Define the Linear class as it appears in the function
class Linear(nn.Module):
    def __init__(self, in_dim, out_dim, bias=True, w_init='linear'):
        super().__init__()
        self.linear_layer = nn.Linear(in_dim, out_dim, bias=bias)
        nn.init.xavier_uniform_(self.linear_layer.weight, gain=nn.init.calculate_gain(w_init))

    def forward(self, x):
        return self.linear_layer(x)

# Define the MultiheadAttention class as it appears in the function
class MultiheadAttention(nn.Module):
    def __init__(self, num_hidden_k):
        super().__init__()
        self.num_hidden_k = num_hidden_k
        self.attn_dropout = nn.Dropout(p=0.1)

    def forward(self, key, value, query):
        import math
        attn = torch.bmm(query, key.transpose(1, 2))
        attn = attn / math.sqrt(self.num_hidden_k)
        attn = torch.softmax(attn, dim=-1)
        attn = self.attn_dropout(attn)
        output = torch.bmm(attn, value)
        return (output, attn)

# Define the Attention class as it appears in the function
class Attention(nn.Module):
    def __init__(self, num_hidden, n_heads=4):
        super().__init__()
        self.num_hidden = num_hidden
        self.num_hidden_per_attn = num_hidden // n_heads
        self.n_heads = n_heads
        self.encoder_key = Linear(num_hidden, num_hidden, bias=False)
        self.encoder_value = Linear(num_hidden, num_hidden, bias=False)
        self.encoder_query = Linear(num_hidden, num_hidden, bias=False)
        self.multihead = MultiheadAttention(self.num_hidden_per_attn)
        self.residual_dropout = nn.Dropout(p=0.1)
        self.final_linear = Linear(num_hidden * 2, num_hidden)
        self.layer_norm = nn.LayerNorm(num_hidden)

    def forward(self, key, value, query):
        from einops import rearrange
        pattern = 'b n (nh nhpa) -> (nh b) n nhpa'
        key_enc = rearrange(self.encoder_key(key), pattern, nh=self.n_heads)
        value_enc = rearrange(self.encoder_value(value), pattern, nh=self.n_heads)
        query_enc = rearrange(self.encoder_query(query), pattern, nh=self.n_heads)
        output, attns = self.multihead(key_enc, value_enc, query_enc)
        output = rearrange(output, '(nh b) sq nhpa -> b sq (nh nhpa)', nh=self.n_heads)
        output = torch.cat([query, output], dim=-1)
        output = self.final_linear(output)
        output = self.residual_dropout(output)
        output += query
        output = self.layer_norm(output)
        return (output, attns)

# Set up arguments for DeterministicEncoder
num_hidden = 8
num_latent = 6
dim_x = 3
dim_y = 5

# Create sample tensors with distinct sizes to avoid ambiguity
batch_size = 2
num_context_points = 4
num_target_points = 3

context_x = torch.randn(batch_size, num_context_points, dim_x)
context_y = torch.randn(batch_size, num_context_points, dim_y)
target_x = torch.randn(batch_size, num_target_points, dim_x)

ARGS = {
    'num_hidden': num_hidden,
    'num_latent': num_latent,
    'dim_x': dim_x,
    'dim_y': dim_y,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type DeterministicEncoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a DeterministicEncoder 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
LatentEncoder Ran
ran on a synthesized input · constructed an object; no result was computed
amazon-science/probconserv/deep_pdes/attentive_neural_process/probconserv.py
code served (permissive licence) · get_code("868f64d33b0f779e")
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 an instance of its own class, LatentEncoder: the run constructed the object and did not call it, so no result was computed. 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
from einops import rearrange, reduce
import math

torch.manual_seed(0)

class Linear(nn.Module):
    def __init__(self, in_dim, out_dim, bias=True, w_init='linear'):
        super().__init__()
        self.linear_layer = nn.Linear(in_dim, out_dim, bias=bias)
        nn.init.xavier_uniform_(self.linear_layer.weight, gain=nn.init.calculate_gain(w_init))

    def forward(self, x):
        return self.linear_layer(x)

class MultiheadAttention(nn.Module):
    def __init__(self, num_hidden_k):
        super().__init__()
        self.num_hidden_k = num_hidden_k
        self.attn_dropout = nn.Dropout(p=0.1)

    def forward(self, key, value, query):
        attn = torch.bmm(query, key.transpose(1, 2))
        attn = attn / math.sqrt(self.num_hidden_k)
        attn = torch.softmax(attn, dim=-1)
        attn = self.attn_dropout(attn)
        output = torch.bmm(attn, value)
        return (output, attn)

class Attention(nn.Module):
    def __init__(self, num_hidden, n_heads=4):
        super().__init__()
        self.num_hidden = num_hidden
        self.num_hidden_per_attn = num_hidden // n_heads
        self.n_heads = n_heads
        self.encoder_key = Linear(num_hidden, num_hidden, bias=False)
        self.encoder_value = Linear(num_hidden, num_hidden, bias=False)
        self.encoder_query = Linear(num_hidden, num_hidden, bias=False)
        self.multihead = MultiheadAttention(self.num_hidden_per_attn)
        self.residual_dropout = nn.Dropout(p=0.1)
        self.final_linear = Linear(num_hidden * 2, num_hidden)
        self.layer_norm = nn.LayerNorm(num_hidden)

    def forward(self, key, value, query):
        pattern = 'b n (nh nhpa) -> (nh b) n nhpa'
        key_enc = rearrange(self.encoder_key(key), pattern, nh=self.n_heads)
        value_enc = rearrange(self.encoder_value(value), pattern, nh=self.n_heads)
        query_enc = rearrange(self.encoder_query(query), pattern, nh=self.n_heads)
        output, attns = self.multihead(key_enc, value_enc, query_enc)
        output = rearrange(output, '(nh b) sq nhpa -> b sq (nh nhpa)', nh=self.n_heads)
        output = torch.cat([query, output], dim=-1)
        output = self.final_linear(output)
        output = self.residual_dropout(output)
        output += query
        output = self.layer_norm(output)
        return (output, attns)

class LatentEncoder(nn.Module):
    def __init__(self, num_hidden, num_latent, dim_x, dim_y):
        super().__init__()
        input_dim = dim_x + dim_y
        self.input_projection = Linear(input_dim, num_hidden)
        self.self_attentions = nn.ModuleList([Attention(num_hidden) for _ in range(2)])
        self.penultimate_layer = Linear(num_hidden, num_hidden, w_init='relu')
        self.mu = Linear(num_hidden, num_latent)
        self.log_sigma = Linear(num_hidden, num_latent)

    def forward(self, x, y):
        encoder_input = torch.cat([x, y], dim=-1)
        encoder_input = self.input_projection(encoder_input)
        for attention in self.self_attentions:
            encoder_input, _ = attention(encoder_input, encoder_input, encoder_input)
        hidden = encoder_input.mean(dim=1)
        hidden = torch.relu(self.penultimate_layer(hidden))
        mu = self.mu(hidden)
        log_sigma = self.log_sigma(hidden)
        std = torch.exp(0.5 * log_sigma)
        eps = torch.randn_like(std)
        z = eps.mul(std).add_(mu)
        return (mu, log_sigma, z)

# Setup arguments
ARGS = {
    'num_hidden': 8,
    'num_latent': 3,
    'dim_x': 4,
    'dim_y': 5,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type LatentEncoder — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a LatentEncoder 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
Linear Ran
ran on a synthesized input · constructed an object; no result was computed
amazon-science/probconserv/deep_pdes/attentive_neural_process/probconserv.py
code served (permissive licence) · get_code("0c114347b4d5b3e6")
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 an instance of its own class, Linear: the run constructed the object and did not call it, so no result was computed. 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)

ARGS = {
    'in_dim': 4,
    'out_dim': 3,
    'bias': True,
    'w_init': 'linear'
}
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 Linear — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a Linear 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
MultiheadAttention Ran
ran on a synthesized input · constructed an object; no result was computed
amazon-science/probconserv/deep_pdes/attentive_neural_process/probconserv.py
code served (permissive licence) · get_code("fc456591ed6ce764")
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 an instance of its own class, MultiheadAttention: the run constructed the object and did not call it, so no result was computed. 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 torch import nn
import math

torch.manual_seed(0)

# Construct the model
model = nn.Module()

# Define ARGS for the forward method
# The forward method expects: key, value, query
# All should be tensors with compatible shapes for the operations

batch_size = 2
num_hidden_k = 4
seq_len_k = 3
seq_len_q = 5

# query shape: (batch, seq_len_q, num_hidden_k)
query = torch.randn(batch_size, seq_len_q, num_hidden_k)

# key shape: (batch, seq_len_k, num_hidden_k)
key = torch.randn(batch_size, seq_len_k, num_hidden_k)

# value shape: (batch, seq_len_k, num_hidden_k)
value = torch.randn(batch_size, seq_len_k, num_hidden_k)

ARGS = {
    "num_hidden_k": num_hidden_k,
}

# Also prepare forward pass arguments for testing
FORWARD_ARGS = {
    "key": key,
    "value": value,
    "query": query,
}
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 MultiheadAttention — the run constructed an instance of its own class and did not call it; no shape is stated — the instrument coerces any output to an array; for a MultiheadAttention 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
_get_second_deriv_mat Ran
ran, honoured the contract we drafted
amazon-science/probconserv/deep_pdes/attentive_neural_process/probconserv.py
code served (permissive licence) · get_code("f90ab48d1192a606")
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 (3, 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 torch

torch.manual_seed(0)

# The function _get_second_deriv_mat takes a single parameter nx (number of points)
# It creates an identity matrix of size nx x nx, then constructs a second derivative
# matrix by stacking three slices of the identity matrix with different offsets

nx = 5

ARGS = {
    "nx": nx,
}
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 (3, 5) — shape (3, 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
_get_second_derivative_var Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
amazon-science/probconserv/deep_pdes/attentive_neural_process/probconserv.py
code served (permissive licence) · get_code("5edc3fc22a03e116")
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 4, dtype family float, shape (2, 3, 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

torch.manual_seed(0)

# The function expects a tensor with shape (nf, nt, nx, _)
# where nf, nt, nx are extracted and the last dimension is implicit
# The function slices along dimension 2 (nx dimension) using :-2, 1:-1, and 2:
# So we need at least 3 elements in the nx dimension to make this work
# Let's use shape (2, 3, 5, 4) for (nf, nt, nx, last_dim)

cov = torch.randn(2, 3, 5, 4)

ARGS = {
    "cov": cov,
    "alpha": 0.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 4, dtype family float, shape (2, 3, 3, 4) — shape (2, 3, 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
apply_non_linear_ineq_constraint Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
amazon-science/probconserv/deep_pdes/attentive_neural_process/probconserv.py
code served (permissive licence) · get_code("862c973a482ccbe4")
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 Tensor, ndim 4, 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)

# Create small tensors with distinct dimensions
# new_mu shape: (nf, nt, nx, 1) where nf=2, nt=3, nx=4
nf, nt, nx = 2, 3, 4
new_mu = torch.randn(nf, nt, nx, 1)

# new_cov shape: (nf, nt, nx, nx) - covariance matrices must be positive definite
# Create positive definite matrices by A @ A.T
new_cov_list = []
for _ in range(nf):
    cov_t_list = []
    for _ in range(nt):
        A = torch.randn(nx, nx)
        cov_matrix = A @ A.T + torch.eye(nx) * 0.1  # Add identity for stability
        cov_t_list.append(cov_matrix)
    new_cov_list.append(torch.stack(cov_t_list, dim=0))
new_cov = torch.stack(new_cov_list, dim=0)

# Initialize the global dict for caching diff matrices
import sys
current_module = sys.modules[__name__]
current_module._diff_matrices = {}

ARGS = {
    'new_mu': new_mu,
    'new_cov': new_cov,
    'tol': 1e-08,
    'max_iter': 1,
    'mode': 'monotone'
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
einops, numpy, scipy, torch, tqdm — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float — no output shape is stated: observe_signature.py could not observe it (fixture:KeyError)
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_cov_tilde_as_projection Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
amazon-science/probconserv/deep_pdes/attentive_neural_process/probconserv.py
code served (permissive licence) · get_code("ebfa11fc11be9ee2")
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 Tensor, ndim 4, dtype family float, shape (2, 3, 4, 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
from einops import rearrange, reduce

torch.manual_seed(0)

# Create a small variance tensor with shape (n, nt, nx, 1)
# n=2 (batch), nt=3 (time steps), nx=4 (spatial/feature dimension)
variance = torch.randn(2, 3, 4, 1).abs() + 0.1  # Add small constant to ensure positive variance

ARGS = {
    "variance": variance
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
einops, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 4, dtype family float, shape (2, 3, 4, 4) — shape (2, 3, 4, 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
get_mu_tilde_as_projection Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
amazon-science/probconserv/deep_pdes/attentive_neural_process/probconserv.py
code served (permissive licence) · get_code("d80230f4a8355b1f")
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 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 numpy as np
from einops import rearrange, reduce

torch.manual_seed(0)

# Create small tensors with shape (n, nt, nx, 1)
# Using distinct sizes: n=2, nt=3, nx=4, last_dim=1
mu = torch.randn(2, 3, 4, 1)
variance = torch.randn(2, 3, 4, 1).abs() + 0.1  # ensure positive for variance

ARGS = {
    "mu": mu,
    "variance": variance,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
einops, 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 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
ANP Not yet run
unverified (harvested, no recorded run)
amazon-science/probconserv/deep_pdes/attentive_neural_process/probconserv.py
code served (permissive licence) · get_code("cf283110e1c4d57c")
How it ran

no invocation recorded.

Decoder Not yet run
unverified (harvested, no recorded run)
amazon-science/probconserv/deep_pdes/attentive_neural_process/probconserv.py
code served (permissive licence) · get_code("4d1194aa0f452075")
How it ran

no invocation recorded.

PhysNP Not yet run
unverified (harvested, no recorded run)
amazon-science/probconserv/deep_pdes/attentive_neural_process/probconserv.py
code served (permissive licence) · get_code("8ac5d2eae63272ef")
How it ran

no invocation recorded.

_apply_g Not yet run
unverified (harvested, no recorded run)
amazon-science/probconserv/deep_pdes/attentive_neural_process/probconserv.py
code served (permissive licence) · get_code("cb5f9cc3ba938241")
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-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

Recent work in scientific machine learning (SciML) has focused on incorporating partial differential equation (PDE) information into the learning process. Much of this work has focused on relatively "easy" PDE operators (e.g., elliptic and parabolic), with less emphasis on relatively "hard" PDE operators (e.g., hyperbolic). Within numerical PDEs, the latter problem class requires control of a type of volume element or conservation constraint, which is known to be challenging. Delivering on the promise of SciML requires seamlessly incorporating both types of problems into the learning process. To address this issue, we propose ProbConserv, a framework for incorporating conservation constraints into a generic SciML architecture. To do so, ProbConserv combines the integral form of a conservation law with a Bayesian update. We provide a detailed analysis of ProbConserv on learning with the Generalized Porous Medium Equation (GPME), a widely-applicable parameterized family of PDEs that illustrates the qualitative properties of both easier and harder PDEs. ProbConserv is effective for easy GPME variants, performing well with state-of-the-art competitors; and for harder GPME variants it outperforms other approaches that do not guarantee volume conservation. ProbConserv seamlessly enforces physical conservation constraints, maintains probabilistic uncertainty quantification (UQ), and deals well with shocks and heteroscedasticities. In each case, it achieves superior predictive performance on downstream tasks.

For agents

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

get_harvested_code_for_paper("2302.11002")
get_code_for_paper("2302.11002")
have("2302.11002")

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

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

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

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

Connect an agent — have() is free.