SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2604.02520 · 2026

Neural posterior estimation for scalable and accurate inverse parameter inference in Li-ion batteries

Malik Hassanaly, Corey Randall, Peter Weddle, Paul Gasper, Conlain Kelly, Tanvir Tanim, Kandler Smith

arXiv · PDF · Open in the Atlas

Code that ran

15 of 16 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 0 have no contract verdict; 15 failures of our instrument; 1 no recorded run), measured 2026-11-22; 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/2604.02520.json · badge: /api/ran/2604.02520.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
NatLabRockies/BatFIT canonical (classifier label)
classifier basis: census
15 ran · 1 no recorded run
FunctionStatusWhere it lives
accuracy Ran
ran; our contract draft was wrong, not the code
NatLabRockies/BatFIT/batfit/model/param_utils/metrics.py
code served (permissive licence) · get_code("7f67c4c77fec8f54")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family float, shape (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)

# Create small tensors for output_mean and target
# output_mean: predicted parameter mean (batch_size=2, features=4)
output_mean = torch.randn(2, 4)

# target: ground truth labels (batch_size=2, features=4)
target = torch.randn(2, 4)

ARGS = {
    "output_mean": output_mean,
    "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 1, dtype family float, shape (4,) — shape (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
ae_loss Ran
ran; our contract draft was wrong, not the code
NatLabRockies/BatFIT/batfit/model/ae.py
code served (permissive licence) · get_code("8e361c503d458505")
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 1, 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

torch.manual_seed(0)

# Create small tensors matching the function's usage
batch_size = 2
feature_dim = 4

# recon_x and x should have the same shape
# The function accesses recon_x[:, 0, :] which suggests shape (batch, channels, features)
recon_x = torch.randn(batch_size, 3, feature_dim)
x = torch.randn(batch_size, 3, feature_dim)

# grad_penalty_encoded and mag_encoded are scalars (used with * alpha and * gamma)
grad_penalty_encoded = torch.tensor(0.5)
mag_encoded = torch.tensor(0.3)

# alpha and gamma are floats
alpha = 10000000.0
gamma = 1.0

ARGS = {
    "recon_x": recon_x,
    "x": x,
    "grad_penalty_encoded": grad_penalty_encoded,
    "mag_encoded": mag_encoded,
    "alpha": alpha,
    "gamma": gamma,
}
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, ndim 1, dtype family float — 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
collect_observation_files Ran
ran; our contract draft was wrong, not the code
NatLabRockies/BatFIT/batfit/calibration/cal_utils.py
code served (permissive licence) · get_code("20ac456c244bcd5d")
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 dict. 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 tempfile
import os
from pathlib import Path

# Create a simple mock class for args_cal
class ArgsCal:
    def __init__(self):
        self.cyc_mode = 'discharge-chargecc'
        self.obsFolder = tempfile.gettempdir()
        self.cell_id = 'cell_001'
        self.cycle_id = 5
        
# Mock the obs_filename function - it needs to exist in scope
def obs_filename(obsFolder, cell_id, cycle_id, nave, cyc_mode, target):
    """Mock function that returns a filename string"""
    return f"{obsFolder}/{cell_id}_cycle{cycle_id}_nave{nave}_{cyc_mode}_{target}.txt"

# Inject the mock function into the module namespace
import sys
current_module = sys.modules[__name__]
setattr(current_module, 'obs_filename', obs_filename)

# Now we can define the function (in real usage it would be imported)
def collect_observation_files(args_cal, nave):
    filename = {}
    if args_cal.cyc_mode == 'discharge' or args_cal.cyc_mode == 'discharge-chargecc':
        filename['discharge'] = {}
        filename['discharge']['phis_c'] = obs_filename(args_cal.obsFolder, args_cal.cell_id, args_cal.cycle_id, nave, cyc_mode='discharge', target='phis_c')
        filename['discharge']['dQ_dV'] = obs_filename(args_cal.obsFolder, args_cal.cell_id, args_cal.cycle_id, nave, cyc_mode='discharge', target='dQ_dV')
        filename['discharge']['dV_dQ'] = obs_filename(args_cal.obsFolder, args_cal.cell_id, args_cal.cycle_id, nave, cyc_mode='discharge', target='dV_dQ')
    if args_cal.cyc_mode == 'chargecc' or args_cal.cyc_mode == 'discharge-chargecc':
        filename['chargecc'] = {}
        filename['chargecc']['phis_c'] = obs_filename(args_cal.obsFolder, args_cal.cell_id, args_cal.cycle_id, nave, cyc_mode='chargecc', target='phis_c')
        filename['chargecc']['dQ_dV'] = obs_filename(args_cal.obsFolder, args_cal.cell_id, args_cal.cycle_id, nave, cyc_mode='chargecc', target='dQ_dV')
        filename['chargecc']['dV_dQ'] = obs_filename(args_cal.obsFolder, args_cal.cell_id, args_cal.cycle_id, nave, cyc_mode='chargecc', target='dV_dQ')
    return filename

# Define ARGS with valid arguments
ARGS = {
    'args_cal': ArgsCal(),
    'nave': 10
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
createFn Ran
ran; our contract draft was wrong, not the code
NatLabRockies/BatFIT/batfit/basicutilityc/ReadInput.py
code served (permissive licence) · get_code("fca3acdd35b38026")
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 dict. 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

# Create a minimal package/module stand-in
class MinimalPackage:
    pass

# Create some minimal functions to be discovered by getattr_multisource
def simple_fn(x, y, z):
    """A simple function that takes one nested arg and two regular args"""
    return {"result": x, "y": y, "z": z}

def nested_fn(a, b):
    """A nested function that takes two regular args"""
    return a + b

def base_fn(alpha):
    """A base function that takes one regular arg"""
    return alpha * 2

# Attach these functions to the package
pkg = MinimalPackage()
pkg.simple_fn = simple_fn
pkg.nested_fn = nested_fn
pkg.base_fn = base_fn

# Create the nested dict structure that matches the docstring example
nested_dict_config = {
    'name': 'simple_fn',
    'kwargs': {
        'x': {
            'name': 'nested_fn',
            'kwargs': {
                'a': {
                    'name': 'base_fn',
                    'kwargs': {
                        'alpha': 5
                    }
                },
                'b': 3
            }
        },
        'y': 10,
        'z': 15
    }
}

# Simple case: just a function name string
simple_fn_name = 'simple_fn'

ARGS = {
    'fnName': nested_dict_config,
    'pkgName': pkg
}
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 dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
grad_hand Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
NatLabRockies/BatFIT/batfit/calibration/data_utils.py
code served (permissive licence) · get_code("a2cd94f4e561eebd")
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 2, 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
import scipy.signal

# Create small test arrays
np.random.seed(0)
n = 50  # Small array size
x = np.linspace(0, 10, n).astype(np.float64)
y = np.sin(x) + np.random.normal(0, 0.1, n).astype(np.float64)
t_tmp = np.arange(n, dtype=np.float64)

ARGS = {
    "x": x,
    "y": y,
    "winsize": 35,
    "poly": 1,
    "t_tmp": t_tmp,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, scipy — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type tuple, ndim 2, dtype family float — 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
identifiability Ran
ran; our contract draft was wrong, not the code
NatLabRockies/BatFIT/batfit/model/param_utils/metrics.py
code served (permissive licence) · get_code("312f2cc71d297cfb")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family float, shape (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)

# output_std is a tensor of predicted parameter marginal standard deviations
# The function computes mean(1/output_std) along axis 0
# We need a tensor with shape (batch_size, num_params)
output_std = torch.rand(2, 4) + 0.1  # Add 0.1 to avoid division by very small numbers

ARGS = {
    "output_std": output_std
}
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 float, shape (4,) — shape (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
independent_gumbel_loss Ran
ran; our contract draft was wrong, not the code
NatLabRockies/BatFIT/batfit/model/param_utils/losses.py
code served (permissive licence) · get_code("0f97b32c7326cae8")
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
import numpy as np

torch.manual_seed(0)

# The function takes three parameters: mu, sigma, and target
# All are used in tensor operations, so they should be torch tensors
# They need to be broadcastable/compatible for the operations:
# - (target - mu) / beta
# - torch.log(beta) + z + torch.exp(-z)

# Create small tensors with batch size 2 and dimension 4
batch_size = 2
dim = 4

mu = torch.randn(batch_size, dim)
sigma = torch.abs(torch.randn(batch_size, dim)) + 0.1  # Ensure positive values
target = torch.randn(batch_size, dim)

ARGS = {
    "mu": mu,
    "sigma": sigma,
    "target": 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 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
indices2slice Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
NatLabRockies/BatFIT/batfit/basicutilityc/slicetools.py
code served (permissive licence) · get_code("1740448efcd0bbfb")
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 torch
import numpy as np

# Construct arguments for indices2slice
ARGS = {
    "indices": [[1, 2], "3:-1:2"],
    "axis": [1, 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 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
mse_loss Ran
ran; our contract draft was wrong, not the code
NatLabRockies/BatFIT/batfit/model/param_utils/losses.py
code served (permissive licence) · get_code("22a25d48c7b271f4")
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 for output and target
# Both should have the same shape for MSE loss computation
output = torch.randn(2, 4)
target = torch.randn(2, 4)

ARGS = {
    "output": output,
    "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
pinball_loss Ran
ran; our contract draft was wrong, not the code
NatLabRockies/BatFIT/batfit/model/param_utils/losses.py
code served (permissive licence) · get_code("258a01dbe4968784")
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)

# Construct small tensors for the pinball_loss function
# mu: mean predictions, shape (2, 4)
mu = torch.randn(2, 4)

# sigma: standard deviation predictions, shape (2, 4)
sigma = torch.randn(2, 4).abs() + 0.1  # Ensure positive values

# target: ground truth values, shape (2, 4)
target = torch.randn(2, 4)

ARGS = {
    "mu": mu,
    "sigma": sigma,
    "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
readFile Ran
ran; our contract draft was wrong, not the code
NatLabRockies/BatFIT/batfit/calibration/data_utils.py
code served (permissive licence) · get_code("749f14f18ac3a486")
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 dict. 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
import pandas as pd
import tempfile
import os

# Create a temporary CSV file with the expected structure
temp_dir = tempfile.gettempdir()
temp_filename = os.path.join(temp_dir, "test_data.csv")

# Create sample data with 7 columns (indices 0-6, with column 5 being phis_c, column 4 being c, column 2 being t, column -1 being state)
sample_data = {
    'col0': [1, 2, 3, 4, 5],
    'col1': [10, 20, 30, 40, 50],
    'col2': [0.1, 0.2, 0.3, 0.4, 0.5],  # time in minutes
    'col3': [100, 200, 300, 400, 500],
    'col4': [0.01, 0.02, 0.03, 0.04, 0.05],  # c values (will be divided by 0.0189)
    'col5': [1.5, 1.6, 1.7, 1.8, 1.9],  # phis_c
    'col6': [0, 0, 1, 1, 0],  # state
}

df = pd.DataFrame(sample_data)
df.to_csv(temp_filename, index=False)

ARGS = {
    'filename': temp_filename,
    'min_t': 1,
    'max_t': 20,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
numpy, pandas — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
read_yaml Ran
ran; our contract draft was wrong, not the code
NatLabRockies/BatFIT/batfit/basicutilityc/ReadInput.py
code served (permissive licence) · get_code("7a67c8ad55771005")
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 dict. 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 yaml
import tempfile
import os

# Create a temporary YAML file for testing
temp_dir = tempfile.mkdtemp()
yaml_file = os.path.join(temp_dir, "test.yaml")

# Write a sample YAML file
sample_yaml = {
    "key1": "value1",
    "key2": 42,
    "nested": {
        "inner_key": "inner_value",
        "inner_list": [1, 2, 3]
    }
}

with open(yaml_file, 'w') as f:
    yaml.dump(sample_yaml, f)

ARGS = {
    "filename": yaml_file
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
yaml — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type dict — a dict output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a dict 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
rel_accuracy Ran
ran; our contract draft was wrong, not the code
NatLabRockies/BatFIT/batfit/model/param_utils/metrics.py
code served (permissive licence) · get_code("5e09a771329c7c01")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 1, dtype family float, shape (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)

# Create small tensors for output_mean and target
# Both should have compatible shapes for element-wise operations
# output_mean: predicted parameter mean (batch_size=2, features=4)
output_mean = torch.randn(2, 4)

# target: ground truth labels (batch_size=2, features=4)
target = torch.randn(2, 4)

ARGS = {
    "output_mean": output_mean,
    "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 1, dtype family float, shape (4,) — shape (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
setup_logging Ran
ran; our contract draft was wrong, not the code
NatLabRockies/BatFIT/batfit/logging_config.py
code served (permissive licence) · get_code("fcf7a6d4c864cee5")
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 RootLogger. 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 logging
from pathlib import Path
import tempfile

ARGS = {
    "logfile": None,
    "level": logging.INFO,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
none outside the standard library — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type RootLogger — a RootLogger output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a RootLogger 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
vae_loss Ran
ran; our contract draft was wrong, not the code
NatLabRockies/BatFIT/batfit/model/vae.py
code served (permissive licence) · get_code("2317e82fdb157476")
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 1, 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 torch.nn as nn

torch.manual_seed(0)

# Create small tensors with distinct sizes for clarity
batch_size = 2
feature_dim = 4
latent_dim = 3

# recon_x: reconstructed output from VAE decoder
# Shape: (batch_size, 1, feature_dim) - note the middle dimension is 1 for the diff operation
recon_x = torch.randn(batch_size, 1, feature_dim)

# x: original input data
# Same shape as recon_x
x = torch.randn(batch_size, 1, feature_dim)

# mu: mean of the latent distribution
# Shape: (batch_size, latent_dim)
mu = torch.randn(batch_size, latent_dim)

# logvar: log variance of the latent distribution
# Shape: (batch_size, latent_dim)
logvar = torch.randn(batch_size, latent_dim)

# kl_weight: weighting factor for KL divergence (has default value)
kl_weight = 1.0

ARGS = {
    "recon_x": recon_x,
    "x": x,
    "mu": mu,
    "logvar": logvar,
    "kl_weight": kl_weight,
}
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, ndim 1, dtype family float — 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
apply_noise Not yet run
unverified (harvested, no recorded run)
NatLabRockies/BatFIT/batfit/model/ae.py
code served (permissive licence) · get_code("aab827a4400fecfb")
How it ran

no invocation recorded.

Also present in other papers' code

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

Diagnosing the internal state of Li-ion batteries is critical for battery research, operation of real-world systems, and prognostic evaluation of remaining lifetime. By using physics-based models to perform probabilistic parameter estimation via Bayesian calibration, diagnostics can account for the uncertainty due to model fitness, data noise, and the observability of any given parameter. However, Bayesian calibration in Li-ion batteries using electrochemical data is computationally intensive even when using a fast surrogate in place of physics-based models, requiring many thousands of model evaluations. A fully amortized alternative is neural posterior estimation (NPE). NPE shifts the computational burden from the parameter estimation step to data generation and model training, reducing the parameter estimation time from minutes to milliseconds, enabling real-time applications. The present work shows that NPE calibrates parameters equally or more accurately than Bayesian calibration, and we demonstrate that the higher computational costs for data generation are tractable even in high-dimensional cases (ranging from 6 to 27 estimated parameters), but the NPE method can lead to higher voltage prediction errors. The NPE method also offers several interpretability advantages over Bayesian calibration, such as local parameter sensitivity to specific regions of the voltage curve. The NPE method is demonstrated using an experimental fast charge dataset, with parameter estimates validated against measurements of loss of lithium inventory and loss of active material. The implementation is made available in a companion repository (https://github.com/NatLabRockies/BatFIT).

For agents

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

get_harvested_code_for_paper("2604.02520")
get_code_for_paper("2604.02520")
have("2604.02520")

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

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

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

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

Connect an agent — have() is free.