SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1912.12976 · 2019

Incorporating physical constraints in a deep probabilistic machine learning framework for coarse-graining dynamical systems

arXiv · PDF · Open in the Atlas

Code that ran

7 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 0 failures of our instrument; 3 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/1912.12976.json · badge: /api/ran/1912.12976.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
SebastianKaltenbach/PhysicalConstraints_ProbabilisticCG canonical (classifier label)
classifier basis: census
7 ran · 3 no recorded run
FunctionStatusWhere it lives
calcELBO Ran
ran on a synthesized input
SebastianKaltenbach/PhysicalConstraints_ProbabilisticCG/Particle/Utilities2.py
code served (permissive licence) · get_code("3571b741f3aee05d")
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 float64, ndim 0, 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 numpy as np

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

# Determine dimensions from function usage
n_rea = 3  # number of realisations
nbin = 4   # number of bins
sig_shape = (nbin, n_rea)
res_shape = (nbin, n_rea)
tauab_shape = (2,)
St_shape = (nbin, nbin)
mt_shape = (n_rea, nbin)

# Construct arguments
sigcd = np.random.randn(nbin, n_rea) * 0.1  # small log-variance values
tauab = np.array([2.0, 0.5])  # shape and rate parameters for gamma
res = np.random.randn(nbin, n_rea) * 0.1  # residuals, relatively small
sig = np.random.randn(nbin, n_rea) * 0.1  # log-variances
mt = np.random.rand(n_rea, nbin) + 0.1  # counts/intensities, positive
St = np.eye(nbin) + np.random.randn(nbin, nbin) * 0.01  # covariance matrix, near identity
rrr = 1.0  # regularization parameter
n_rea = n_rea

ARGS = {
    'sigcd': sigcd,
    'tauab': tauab,
    'res': res,
    'sig': sig,
    'mt': mt,
    'n_rea': n_rea,
    'nbin': nbin,
    'St': St,
    'rrr': rrr
}
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 float64, ndim 0, dtype family float — no output shape is stated: observe_signature.py recorded float ndim 0, which disagrees with the fixture run
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
evolution_lib Ran
ran on a synthesized input
SebastianKaltenbach/PhysicalConstraints_ProbabilisticCG/Pendulum/model.py
code served (permissive licence) · get_code("a5cae562963c36a7")
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 SymbolicTensor. 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 tensorflow as tf
import numpy as np

# The function takes a single parameter 'z' which is used as:
# - z is indexed with [:, 0] to get the first column
# - tf.shape(z)[0] is used to get the batch size
# - So z should be a 2D tensor with shape (batch_size, num_features)

# Create a small 2D TensorFlow tensor
# batch size = 2, num_features = 4
z = tf.constant([
    [1.0, 2.0, 3.0, 4.0],
    [5.0, 6.0, 7.0, 8.0]
], dtype=tf.float32)

ARGS = {
    "z": z
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type SymbolicTensor — a SymbolicTensor 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_normal_pdf Ran
ran on a synthesized input
SebastianKaltenbach/PhysicalConstraints_ProbabilisticCG/Pendulum/model.py
code served (permissive licence) · get_code("1ecebd77cfee0fa7")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned EagerTensor, ndim 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 tensorflow as tf
import numpy as np

# Create sample tensors with distinct sizes for different dimensions
batch_size = 2
dim = 4

sample = tf.constant(np.random.randn(batch_size, dim).astype(np.float32))
mean = tf.constant(np.random.randn(batch_size, dim).astype(np.float32))
logvar = tf.constant(np.random.randn(batch_size, dim).astype(np.float32))
raxis = 1

ARGS = {
    "sample": sample,
    "mean": mean,
    "logvar": logvar,
    "raxis": raxis,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 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
mufunc Ran
ran on a synthesized input
SebastianKaltenbach/PhysicalConstraints_ProbabilisticCG/Particle/Pred.py
code served (permissive licence) · get_code("f88d9f747163a87f")
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 float32, 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
import numpy as np

torch.manual_seed(0)

# Analyze the function:
# - a: indexed as a[i + L], so it's a 1D array of size 2*L + 1
# - b: indexed as b[i + L, j + L], so it's a 2D array of shape (2*L + 1, 2*L + 1)
# - n0: indexed as n0[(k + i) % nbin] and n0[(k + j) % nbin], so it's a 1D array of size nbin
# - k: an integer index into n0
# - nbin: the size of n0 (number of bins)
# - L: the range parameter for loops
# - Dt: a scalar multiplier

# Set up small but distinct dimensions
L = 2  # range parameter
nbin = 5  # number of bins
k = 1  # current bin index (should be < nbin)

# Create a with shape (2*L + 1,) = (5,)
a = np.array([0.1, 0.2, 0.3, 0.4, 0.5], dtype=np.float32)

# Create b with shape (2*L + 1, 2*L + 1) = (5, 5)
b = np.random.randn(2*L + 1, 2*L + 1).astype(np.float32)

# Create n0 with size nbin
n0 = np.array([1.0, 2.0, 3.0, 4.0, 5.0], dtype=np.float32)

# Dt is a scalar
Dt = 0.5

ARGS = {
    "a": a,
    "b": b,
    "n0": n0,
    "k": k,
    "Dt": Dt,
    "L": L,
    "nbin": nbin
}
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 float32, 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
normal_pdf Ran
ran on a synthesized input
SebastianKaltenbach/PhysicalConstraints_ProbabilisticCG/Pendulum/model.py
code served (permissive licence) · get_code("51ee0995719af9ec")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned EagerTensor, ndim 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 tensorflow as tf
import numpy as np

# Create small sample tensors
sample = tf.constant(np.random.randn(2, 4).astype(np.float32))
mean = tf.constant(np.random.randn(2, 4).astype(np.float32))
std = tf.constant(np.abs(np.random.randn(2, 4)).astype(np.float32) + 0.1)
raxis = 1

ARGS = {
    "sample": sample,
    "mean": mean,
    "std": std,
    "raxis": raxis
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, tensorflow — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type EagerTensor, ndim 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
setVarphi Ran
ran on a synthesized input
SebastianKaltenbach/PhysicalConstraints_ProbabilisticCG/Particle/Utilities2.py
code served (permissive licence) · get_code("154939c45910aeb9")
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 3, dtype family float, shape (3, 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

# Construct valid arguments for setVarphi
n0 = np.random.randn(5, 3)  # shape (b=5, rea=3)
L = 2  # window parameter
order = 1  # can be 1 or 2

ARGS = {
    "n0": n0,
    "L": L,
    "order": order
}
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 3, dtype family float, shape (3, 5, 5) — shape (3, 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
thetatraf2 Ran
ran on a synthesized input
SebastianKaltenbach/PhysicalConstraints_ProbabilisticCG/Particle/Pred.py
code served (permissive licence) · get_code("a5abb4aa7d36872c")
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

# Determine L value - function expects theta of shape (2*L*L + 5*L + 2,)
L = 2

# Calculate expected size of theta
expected_size = 2 * L * L + 5 * L + 2  # = 2*4 + 5*2 + 2 = 8 + 10 + 2 = 20

# Create thetat as a 1D array of the expected size
thetat = np.random.randn(expected_size)

ARGS = {
    "thetat": thetat,
    "L": L
}
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
tfunc Not yet run
unverified (harvested, no recorded run)
SebastianKaltenbach/PhysicalConstraints_ProbabilisticCG/Particle/ParaOpt2.py
code served (permissive licence) · get_code("dcde5ef84539faf9")
How it ran

no invocation recorded.

thetafunc Not yet run
unverified (harvested, no recorded run)
SebastianKaltenbach/PhysicalConstraints_ProbabilisticCG/Particle/ParaOpt2.py
code served (permissive licence) · get_code("09f5ba5c296d58f3")
How it ran

no invocation recorded.

thetatraf Not yet run
unverified (harvested, no recorded run)
SebastianKaltenbach/PhysicalConstraints_ProbabilisticCG/Particle/Pred.py
code served (permissive licence) · get_code("90cd99a1d8448cb5")
How it ran

no invocation recorded.

Also present in other papers' code

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

Data-based discovery of effective, coarse-grained (CG) models of high-dimensional dynamical systems presents a unique challenge in computational physics and particularly in the context of multiscale problems. The present paper offers a data-based, probablistic perspective that enables the quantification of predictive uncertainties. One of the outstanding problems has been the introduction of physical constraints in the probabilistic machine learning objectives. The primary utility of such constraints stems from the undisputed physical laws such as conservation of mass, energy etc. that they represent. Furthermore and apart from leading to physically realistic predictions, they can significantly reduce the requisite amount of training data which for high-dimensional, multiscale systems are expensive to obtain (Small Data regime). We formulate the coarse-graining process by employing a probabilistic state-space model and account for the aforementioned equality constraints as virtual observables in the associated densities. We demonstrate how probabilistic inference tools can be employed to identify the coarse-grained variables in combination with deep neural nets and their evolution model without ever needing to define a fine-to-coarse (restriction) projection and without needing time-derivatives of state variables. Furthermore, it is capable of reconstructing the evolution of the full, fine-scale system and therefore the observables of interest need not be selected a priori. We demonstrate the efficacy of the proposed framework by applying it to systems of interacting particles and an image-series of a nonlinear pendulum.

For agents

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

get_harvested_code_for_paper("1912.12976")
get_code_for_paper("1912.12976")
have("1912.12976")

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

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

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

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

Connect an agent — have() is free.