SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2210.17299 · 2022

Bayesian Model Selection of Lithium-Ion Battery Models via Bayesian Quadrature

arXiv · PDF · Open in the Atlas

Code that ran

5 of 8 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 2 have no contract verdict; 3 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/2210.17299.json · badge: /api/ran/2210.17299.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
Battery-Intelligence-Lab/BayesianModelSelection canonical (classifier label)
classifier basis not recorded on the link
5 ran · 3 no recorded run
FunctionStatusWhere it lives
ker_svd_sparsify Ran
ran on a synthesized input
Battery-Intelligence-Lab/BayesianModelSelection/BASQ/_rchq.py
code served (permissive licence) · get_code("8163c2cf043b11dd")
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

torch.manual_seed(0)

# The function calls kernel(pt, pt) which should be a callable
# that takes two tensors and returns a kernel matrix
def kernel_fn(x, y):
    # Simple RBF kernel: exp(-||x-y||^2)
    # Returns a matrix of shape (n, m) where n = x.shape[0], m = y.shape[0]
    diff = x.unsqueeze(1) - y.unsqueeze(0)  # (n, m, d)
    distances = torch.sum(diff ** 2, dim=2)  # (n, m)
    return torch.exp(-distances)

# pt: a tensor of points, shape (n, d)
pt = torch.randn(2, 4)

# s: the rank parameter for torch.svd_lowrank, should be an int
s = 2

# kernel: a callable that computes kernel matrix
kernel = kernel_fn

# device: the device to use
device = 'cpu'

ARGS = {
    'pt': pt,
    's': s,
    'kernel': kernel,
    'device': device
}
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
polyinterp Ran
ran; our contract draft was wrong, not the code
Battery-Intelligence-Lab/BayesianModelSelection/BASQ/_lbfgs.py
code served (permissive licence) · get_code("8fdaf484c504fcbd")
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
import matplotlib.pyplot as plt

# Create valid arguments for polyinterp function
# The function takes points as a 2D numpy array where each row is [x, f, g]
# x is position, f is function value, g is gradient/derivative

# Case 1: Simple 2-point interpolation with 2nd order (quadratic)
points = np.array([
    [0.0, 1.0, -0.5],      # point 1: x=0, f=1, g=-0.5
    [1.0, 0.5, 0.2]        # point 2: x=1, f=0.5, g=0.2
], dtype=float)

x_min_bound = -0.5
x_max_bound = 1.5
plot = False

ARGS = {
    "points": points,
    "x_min_bound": x_min_bound,
    "x_max_bound": x_max_bound,
    "plot": plot
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
matplotlib, 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
rc_kernel_svd Ran
ran on a synthesized input
Battery-Intelligence-Lab/BayesianModelSelection/BASQ/_rchq.py
code served (permissive licence) · get_code("03e63ed364d82e2e")
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 torch
import torch.nn as nn

torch.manual_seed(0)

# Define a simple RBF kernel function
def rbf_kernel(x, y, sigma=1.0):
    """Gaussian/RBF kernel"""
    # x: (d, n), y: (d, m) -> output (n, m)
    x_sq = torch.sum(x**2, dim=0, keepdim=True)  # (1, n)
    y_sq = torch.sum(y**2, dim=0, keepdim=True)  # (1, m)
    xy = torch.matmul(x.T, y)  # (n, m)
    dist_sq = x_sq.T + y_sq - 2 * xy  # (n, m)
    return torch.exp(-dist_sq / (2 * sigma**2))

# Create sample data
device = 'cpu'
batch_size = 2
d = 4  # dimension

# samp: list of tensors, each of shape (d,) representing a point
samp = [torch.randn(d) for _ in range(batch_size)]

# pt: tensor of shape (d, num_points) representing Nyström points
pt = torch.randn(d, 3)

# s: sparsity parameter (number of singular values to keep)
s = 2

# kernel: callable that takes two tensors and returns a kernel matrix
kernel = rbf_kernel

ARGS = {
    'samp': samp,
    'pt': pt,
    's': s,
    'kernel': kernel,
    'device': device,
    'mu': 0,
    'use_obj': True,
}
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 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
set_gp Ran
ran; the contract check could not run (RAISES, DEP_MISSING or TIMEOUT)
Battery-Intelligence-Lab/BayesianModelSelection/BASQ/_gp.py
code served (permissive licence) · get_code("b26b7e18aa96454a")
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 ExactGPModel. 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 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 gpytorch
from gpytorch.priors.torch_priors import GammaPrior
from gpytorch.kernels import ScaleKernel, RBFKernel

torch.manual_seed(0)

# Create small training data
train_x = torch.randn(2, 4)
train_y = torch.randn(2)

# Create GP kernel with necessary attributes
gp_kernel = ScaleKernel(RBFKernel())

# Create device
device = torch.device('cpu')

# Build ARGS dict
ARGS = {
    'train_x': train_x,
    'train_y': train_y,
    'gp_kernel': gp_kernel,
    'device': device,
    'lik': 1e-10,
    'rng': 10,
    'train_lik': False
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
gpytorch, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ExactGPModel — a ExactGPModel output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ExactGPModel 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
train_GP_with_Adam Ran
ran; our contract draft was wrong, not the code
Battery-Intelligence-Lab/BayesianModelSelection/BASQ/_gp.py
code served (permissive licence) · get_code("a616e1ee7e9a83cd")
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 ExactMarginalLogLikelihood. 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
import gpytorch

torch.manual_seed(0)

# Define a minimal GPyTorch model
class SimpleGPModel(gpytorch.models.ExactGP):
    def __init__(self, train_x, train_y):
        likelihood = gpytorch.likelihoods.GaussianLikelihood()
        super().__init__(train_x, train_y, likelihood)
        self.mean_module = gpytorch.means.ConstantMean()
        self.covar_module = gpytorch.kernels.ScaleKernel(gpytorch.kernels.RBFKernel())
    
    def forward(self, x):
        mean_x = self.mean_module(x)
        covar_x = self.covar_module(x)
        return gpytorch.distributions.MultivariateNormal(mean_x, covar_x)

# Create small training data (batch size 2, dimension 4)
train_x = torch.randn(2, 4)
train_y = torch.randn(2)

# Initialize the model
model = SimpleGPModel(train_x, train_y)
model.train()

# Create the marginal log likelihood
likelihood = model.likelihood
mll = gpytorch.mlls.ExactMarginalLogLikelihood(likelihood, model)

ARGS = {
    "mll": mll,
    "lr": 0.01,
    "training_iter": 5,
    "thresh": 0.001
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
gpytorch, torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type ExactMarginalLogLikelihood — a ExactMarginalLogLikelihood output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a ExactMarginalLogLikelihood 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
is_legal Not yet run
unverified (harvested, no recorded run)
Battery-Intelligence-Lab/BayesianModelSelection/BASQ/_lbfgs.py
code served (permissive licence) · get_code("e8b2e5cf7b28624f")
How it ran

no invocation recorded.

recombination Not yet run
unverified (harvested, no recorded run)
Battery-Intelligence-Lab/BayesianModelSelection/BASQ/_rchq.py
code served (permissive licence) · get_code("9dcade865205a6d6")
How it ran

no invocation recorded.

train_GP_with_BFGS Not yet run
unverified (harvested, no recorded run)
Battery-Intelligence-Lab/BayesianModelSelection/BASQ/_gp.py
code served (permissive licence) · get_code("83ea557ab0cefab9")
How it ran

no invocation recorded.

Also present in other papers' code

Of 8 samples lifted from this paper's linked repositories, 8 carry a function identity and 0 do not. Of the 8 distinct functions with an identity, 8 are also present in other papers whose code we hold (8 with at least one paper dated earlier, 0 the same month, 3 later) and 0 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
is_legal 3 other papers
3 dated earlier
2109.02606 (2021-09)
Gaussian Process Uniform Error Bounds with Unknown Hyperparameters for Safety-Critical Applications
2205.07460 (2022-05)
Diffusion Models for Adversarial Purification
2206.04734 (2022-06)
Fast Bayesian Inference with Batch Bayesian Quadrature via Kernel Recombination
polyinterp 2 other papers
2 dated earlier
2109.02606 (2021-09)
Gaussian Process Uniform Error Bounds with Unknown Hyperparameters for Safety-Critical Applications
2206.04734 (2022-06)
Fast Bayesian Inference with Batch Bayesian Quadrature via Kernel Recombination
set_gp 2 other papers
1 dated earlier, 1 later
2206.04734 (2022-06)
Fast Bayesian Inference with Batch Bayesian Quadrature via Kernel Recombination
2404.12219 (2024-04)
A Quadrature Approach for General-Purpose Batch Bayesian Optimization via Probabilistic Lifting
train_GP_with_Adam 2 other papers
1 dated earlier, 1 later
2206.04734 (2022-06)
Fast Bayesian Inference with Batch Bayesian Quadrature via Kernel Recombination
2404.12219 (2024-04)
A Quadrature Approach for General-Purpose Batch Bayesian Optimization via Probabilistic Lifting
train_GP_with_BFGS 2 other papers
1 dated earlier, 1 later
2206.04734 (2022-06)
Fast Bayesian Inference with Batch Bayesian Quadrature via Kernel Recombination
2404.12219 (2024-04)
A Quadrature Approach for General-Purpose Batch Bayesian Optimization via Probabilistic Lifting
ker_svd_sparsify 1 other paper
1 dated earlier
2206.04734 (2022-06)
Fast Bayesian Inference with Batch Bayesian Quadrature via Kernel Recombination
rc_kernel_svd 1 other paper
1 dated earlier
2206.04734 (2022-06)
Fast Bayesian Inference with Batch Bayesian Quadrature via Kernel Recombination
recombination 1 other paper
1 dated earlier
2206.04734 (2022-06)
Fast Bayesian Inference with Batch Bayesian Quadrature via Kernel Recombination

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 wide variety of battery models are available, and it is not always obvious which model `best' describes a dataset. This paper presents a Bayesian model selection approach using Bayesian quadrature. The model evidence is adopted as the selection metric, choosing the simplest model that describes the data, in the spirit of Occam's razor. However, estimating this requires integral computations over parameter space, which is usually prohibitively expensive. Bayesian quadrature offers sample-efficient integration via model-based inference that minimises the number of battery model evaluations. The posterior distribution of model parameters can also be inferred as a byproduct without further computation. Here, the simplest lithium-ion battery models, equivalent circuit models, were used to analyse the sensitivity of the selection criterion to given different datasets and model configurations. We show that popular model selection criteria, such as root-mean-square error and Bayesian information criterion, can fail to select a parsimonious model in the case of a multimodal posterior. The model evidence can spot the optimal model in such cases, simultaneously providing the variance of the evidence inference itself as an indication of confidence. We also show that Bayesian quadrature can compute the evidence faster than popular Monte Carlo based solvers.

For agents

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

get_harvested_code_for_paper("2210.17299")
get_code_for_paper("2210.17299")
have("2210.17299")

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

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

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

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

Connect an agent — have() is free.