SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2305.04933 · 2023

Uncertainty Quantification in Machine Learning for Engineering Design and Health Prognostics: A Tutorial

arXiv · PDF · Open in the Atlas

Code that ran

8 of 9 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; 1 honoured the contract we drafted, 0 violated it and 6 have no contract verdict; 1 failure of our instrument; 1 no recorded run), measured 2026-11-23; 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/2305.04933.json · badge: /api/ran/2305.04933.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
vnemani14/uq_ml_review canonical (classifier label)
classifier basis: census
8 ran · 1 no recorded run
FunctionStatusWhere it lives
KL Ran
ran on a synthesized input
vnemani14/uq_ml_review/Toy_problem/MFVI/Models_and_losses.py
code served (permissive licence) · get_code("1ac540103505b8bf")
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 torch.nn as nn

torch.manual_seed(0)

# Create a custom Random_Linear module that the KL function expects
class Random_Linear(nn.Module):
    def __init__(self, in_features, out_features):
        super().__init__()
        self.in_features = in_features
        self.out_features = out_features
        
        # Initialize mu_W and mu_b as parameters
        self.mu_W = nn.Parameter(torch.randn(out_features, in_features))
        self.mu_b = nn.Parameter(torch.randn(out_features))
        
        # Initialize rho_W and rho_b as parameters
        self.rho_W = nn.Parameter(torch.randn(out_features, in_features))
        self.rho_b = nn.Parameter(torch.randn(out_features))
    
    def forward(self, x):
        return x

# Create a model containing Random_Linear modules
class TestModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = Random_Linear(4, 3)
        self.linear2 = Random_Linear(3, 2)
    
    def forward(self, x):
        return x

# Build the model
model = TestModel()

# Define arguments for the KL function
ARGS = {
    "model": model,
    "depth": 3,
    "hid_dim": 50
}
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
MCDO_loss Ran
ran on a synthesized input
vnemani14/uq_ml_review/Toy_problem/MFVI/Models_and_losses.py
code served (permissive licence) · get_code("0d4399f0be9502c7")
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 torch.nn as nn
import numpy as np

torch.manual_seed(0)

# Build a simple model with Linear layers
class SimpleModel(nn.Module):
    def __init__(self):
        super().__init__()
        self.linear1 = nn.Linear(4, 3)
        self.linear2 = nn.Linear(3, 1)
    
    def forward(self, x):
        x = self.linear1(x)
        x = torch.relu(x)
        x = self.linear2(x)
        return x

model = SimpleModel()

# Create small tensors
x = torch.randn(2, 4)  # batch size 2, input dim 4
y = torch.randn(2, 1)  # batch size 2, output dim 1

ARGS = {
    'model': model,
    'x': x,
    'y': y,
    'depth': 1,
    'n_samples': 32,
    'tau': 1,
    'H': 2
}
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
initial_values Ran
ran on a synthesized input
vnemani14/uq_ml_review/Toy_problem/SNGP_Pytorch/dkl.py
code served (permissive licence) · get_code("5f1d65960f069d48")
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. 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 torch.nn as nn

torch.manual_seed(0)

# Create a minimal feature extractor that takes an image tensor and outputs features
class SimpleFeatureExtractor(nn.Module):
    def __init__(self):
        super().__init__()
        self.conv = nn.Conv2d(3, 16, kernel_size=3, padding=1)
        self.pool = nn.AdaptiveAvgPool2d((2, 2))
        self.flatten = nn.Flatten()
        self.fc = nn.Linear(16 * 2 * 2, 8)
    
    def forward(self, x):
        x = self.conv(x)
        x = self.pool(x)
        x = self.flatten(x)
        x = self.fc(x)
        return x

# Create a minimal dataset
class SimpleDataset:
    def __init__(self, num_samples=100):
        self.num_samples = num_samples
    
    def __len__(self):
        return self.num_samples
    
    def __getitem__(self, idx):
        # Return (image_tensor, label)
        # Images are 3x4x4 (channels, height, width)
        x = torch.randn(3, 4, 4)
        y = torch.tensor(idx % 2)
        return (x, y)

# Build the arguments
train_dataset = SimpleDataset(num_samples=100)
feature_extractor = SimpleFeatureExtractor()
n_inducing_points = 5

ARGS = {
    "train_dataset": train_dataset,
    "feature_extractor": feature_extractor,
    "n_inducing_points": n_inducing_points,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
sklearn, 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
math_fun Ran
ran on a synthesized input
vnemani14/uq_ml_review/Toy_problem/MFVI/utils.py
code served (permissive licence) · get_code("090828758e5fbe00")
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 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 numpy as np

def math_fun(x):
    x1 = x[:, 0]
    x2 = x[:, 1]
    g = ((1.5 + x1) ** 2 + 4) * (1.5 + x2) / 20 - np.sin(5 * (1.5 + x1) / 2)
    return g

# Create a small numpy array with shape (batch_size, 2)
# The function expects x to have at least 2 columns (indexing x[:, 0] and x[:, 1])
x = np.array([
    [0.5, 1.2],
    [2.1, -0.3]
], dtype=np.float32)

ARGS = {
    "x": x
}
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 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
mean_field_logits Ran
ran on a synthesized input
vnemani14/uq_ml_review/Case_study_1/lib/gaussian_process.py
code served (permissive licence) · get_code("b30037e8c1a7e5bf")
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 2, dtype family float, shape (2, 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 tensorflow as tf
import numpy as np

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

# Create small test tensors
batch_size = 2
num_classes = 4

# logits: shape (batch_size, num_classes)
logits = tf.constant([
    [1.0, 2.0, 3.0, 4.0],
    [0.5, 1.5, 2.5, 3.5]
], dtype=tf.float32)

# covariance_matrix: shape (batch_size, batch_size)
covariance_matrix = tf.constant([
    [1.0, 0.1],
    [0.1, 1.0]
], dtype=tf.float32)

# mean_field_factor: scalar float
mean_field_factor = 1.0

ARGS = {
    "logits": logits,
    "covariance_matrix": covariance_matrix,
    "mean_field_factor": mean_field_factor,
}
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 2, dtype family float, shape (2, 4) — shape (2, 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
mean_reduction Ran
ran on a synthesized input
vnemani14/uq_ml_review/Toy_problem/MFVI/Models_and_losses.py
code served (permissive licence) · get_code("171949a72ebdcf84")
How it ran

Ran in Syntology's sandbox on this synthesized input (drafted by a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API) and returned Tensor, ndim 2, dtype family float, shape (2, 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 takes preds and y as parameters
# It modifies preds in-place by subtracting y from the first column
# preds needs to be a 2D tensor with at least 1 column
# y needs to be broadcastable to preds[:, [0]]

preds = torch.randn(2, 4)  # batch size 2, 4 dimensions
y = torch.randn(2, 1)      # batch size 2, 1 dimension for broadcasting

ARGS = {
    "preds": preds,
    "y": y
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1, through the batch API
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (2, 4) — shape (2, 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
random_ortho Ran
ran, honoured the contract we drafted
vnemani14/uq_ml_review/Toy_problem/SNGP_Pytorch/sngp.py
code served (permissive licence) · get_code("23d31486a37ba535")
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 2, dtype family float, shape (4, 3) as a later run recorded it. The image it ran in was not recorded. If your copy returns the same type, ndim and shape on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch

torch.manual_seed(0)

ARGS = {
    "n": 4,
    "m": 3,
}
Setup block drafted by
a language model, Claude Haiku 4.5, prompt python_fixture_v1
Imports
torch — import names as written, not package names to install; a name the repository itself provides is not a package
Returned
type Tensor, ndim 2, dtype family float, shape (4, 3) — shape (4, 3) as a later run recorded it
dtype family
int means an integer dtype; float means any other dtype the instrument saw, bool and complex included (fixture_check.py records only these two families)
Environment
image not recorded; re-verify against syntology-harvest-sandbox:v5-deps; not recorded for this sample: the harness installs a cuda-to-cpu shim (cuda_shim.py) before every sample and no run records whether a sample needed it; seed: none by the harness; any seed is in the setup block
spectral_norm_fc Ran
ran; our contract draft was wrong, not the code
vnemani14/uq_ml_review/Toy_problem/SNGP_Pytorch/spectral_norm_fc.py
code served (permissive licence) · get_code("17f1a683435840ab")
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 Linear. The image it ran in was not recorded. If your copy returns the same type on these inputs, it matched what we observed; nothing here checks that. It does NOT mean the output is correct: nothing has compared it to the paper.

import torch
import torch.nn as nn

torch.manual_seed(0)

# Create a simple Linear module to apply spectral norm to
module = nn.Linear(in_features=3, out_features=4, bias=True)

# Define arguments for spectral_norm_fc
ARGS = {
    'module': module,
    'coeff': 2.0,
    'n_power_iterations': 1,
    'name': 'weight',
    'eps': 1e-12,
    'dim': None
}
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 — a Linear output has no array shape of its own; none 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
calculate_calibration Not yet run
unverified (harvested, no recorded run)
vnemani14/uq_ml_review/Toy_problem/MFVI/utils.py
code served (permissive licence) · get_code("920fdd1347a34a6e")
How it ran

no invocation recorded.

Also present in other papers' code

Of 9 samples lifted from this paper's linked repositories, 9 carry a function identity and 0 do not. Of the 9 distinct functions with an identity, 3 are also present in other papers whose code we hold (3 with at least one paper dated earlier, 0 the same month, 1 later) and 6 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
spectral_norm_fc 3 other papers
2 dated earlier, 1 later
2111.02275 (2021-11)
Causal-BALD: Deep Bayesian Active Learning of Outcomes to Infer Treatment-Effects from Observational Data
2204.10022 (2022-04)
Scalable Sensitivity and Uncertainty Analysis for Causal-Effect Estimates of Continuous-Valued Interventions
2410.03446 (2024-10)
On Uncertainty In Natural Language Processing
random_ortho 2 other papers
2 dated earlier
2006.10108 (2020-06)
Simple and Principled Uncertainty Estimation with Deterministic Deep Learning via Distance Awareness
2102.11409 (2021-02)
On Feature Collapse and Deep Kernel Learning for Single Forward Pass Uncertainty
initial_values 1 other paper
1 dated earlier
2102.11409 (2021-02)
On Feature Collapse and Deep Kernel Learning for Single Forward Pass Uncertainty

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-23.

Repositories linked to this paper

Some links come from the archived Papers with Code dataset (CC BY-SA 4.0): attribution and licence.

Abstract

On top of machine learning models, uncertainty quantification (UQ) functions as an essential layer of safety assurance that could lead to more principled decision making by enabling sound risk assessment and management. The safety and reliability improvement of ML models empowered by UQ has the potential to significantly facilitate the broad adoption of ML solutions in high-stakes decision settings, such as healthcare, manufacturing, and aviation, to name a few. In this tutorial, we aim to provide a holistic lens on emerging UQ methods for ML models with a particular focus on neural networks and the applications of these UQ methods in tackling engineering design as well as prognostics and health management problems. Toward this goal, we start with a comprehensive classification of uncertainty types, sources, and causes pertaining to UQ of ML models. Next, we provide a tutorial-style description of several state-of-the-art UQ methods: Gaussian process regression, Bayesian neural network, neural network ensemble, and deterministic UQ methods focusing on spectral-normalized neural Gaussian process. Established upon the mathematical formulations, we subsequently examine the soundness of these UQ methods quantitatively and qualitatively (by a toy regression example) to examine their strengths and shortcomings from different dimensions. Then, we review quantitative metrics commonly used to assess the quality of predictive uncertainty in classification and regression problems. Afterward, we discuss the increasingly important role of UQ of ML models in solving challenging problems in engineering design and health prognostics. Two case studies with source codes available on GitHub are used to demonstrate these UQ methods and compare their performance in the life prediction of lithium-ion batteries at the early stage and the remaining useful life prediction of turbofan engines.

For agents

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

get_harvested_code_for_paper("2305.04933")
get_code_for_paper("2305.04933")
have("2305.04933")

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

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

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

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

Connect an agent — have() is free.