SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 2109.15048 · NeurIPS · 2022

Scale-invariant Learning by Physics Inversion

Philipp Holl, Vladlen Koltun, Nils Thuerey

arXiv · PDF · Open in the Atlas

Code that ran

7 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 7 have no contract verdict; 0 failures of our instrument; 1 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/2109.15048.json · badge: /api/ran/2109.15048.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
ltatzel/PyTorchHessianFree canonical (classifier label)
classifier basis not recorded on the link
7 ran · 0 no recorded run
tum-pbs/sip canonical (classifier label)
classifier basis: classifier_2025
0 ran · 1 no recorded run
FunctionStatusWhere it lives
cg Ran
ran on a synthesized input
ltatzel/PyTorchHessianFree/hessianfree/cg.py
code served (permissive licence) · get_code("5d32fc50353666d3")
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
import torch.nn as nn

torch.manual_seed(0)

# Create a small symmetric positive definite matrix A for testing
# We'll use a 4x4 matrix
dim = 4
A_matrix = torch.randn(dim, dim)
A_matrix = A_matrix @ A_matrix.T + torch.eye(dim)  # Make it SPD

# Define A as a callable (matrix-vector product)
def A(v):
    return A_matrix @ v

# Create right-hand side b
b = torch.randn(dim)

# Create initial guess x0
x0 = torch.zeros(dim)

# Create preconditioning matrix M (inverse of diagonal of A)
diag_A = torch.diag(A_matrix)
def M(v):
    return v / diag_A

# Set max iterations
max_iter = 10

# Set tolerances
tol = 1e-5
atol = 1e-8

# Store x at specific iterations
store_x_at_iters = [0, 5, 10]

# Build the arguments dictionary
ARGS = {
    'A': A,
    'b': b,
    'x0': x0,
    'M': M,
    'max_iter': max_iter,
    'tol': tol,
    'atol': atol,
    'martens_conv_crit': False,
    'store_x_at_iters': store_x_at_iters,
    'verbose': False
}
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
cg_backtracking Ran
ran on a synthesized input
ltatzel/PyTorchHessianFree/hessianfree/cg_backtracking.py
code served (permissive licence) · get_code("5c693bdebbbf88c8")
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 numpy as np

torch.manual_seed(0)

# Define a simple target function that takes a step (tensor or scalar)
# and returns a float loss value
def create_target_function():
    """Create a simple quadratic target function."""
    def f(step):
        # step is expected to be a tensor or scalar
        # Return a scalar float loss
        if isinstance(step, torch.Tensor):
            loss = torch.sum(step ** 2).item()
        else:
            loss = float(step ** 2)
        return loss
    return f

# Create the target function
f = create_target_function()

# Create a list of update steps
# Each step can be a tensor, scalar, or None
steps_list = [
    torch.tensor([0.1, 0.2, 0.3, 0.4]),
    torch.tensor([0.05, 0.1, 0.15, 0.2]),
    None,
    torch.tensor([0.2, 0.3, 0.4, 0.5]),
]

# Define ARGS dictionary with all parameters
ARGS = {
    'f': f,
    'steps_list': steps_list,
    'verbose': True,
}
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 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
cg_efficient_backtracking Ran
ran on a synthesized input
ltatzel/PyTorchHessianFree/hessianfree/cg_backtracking.py
code served (permissive licence) · get_code("7407e7097201614c")
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 numpy as np

torch.manual_seed(0)

# The function f should take a step (which can be various types) and return a float
# We'll create a simple quadratic function that takes a step dict/tensor and evaluates it

def create_target_function():
    """Create a simple target function for testing"""
    def f(step):
        # step could be a dict, list, tensor, etc.
        # We'll handle a simple case where step is a numpy array or similar
        if isinstance(step, np.ndarray):
            # Simple quadratic: sum of squares
            return float(np.sum(step ** 2))
        elif isinstance(step, (list, tuple)):
            return float(np.sum(np.array(step) ** 2))
        else:
            return float(torch.sum(step ** 2).item())
    return f

# Create steps_list - a list of update steps that decrease in quality
# Start with good steps, then worse steps
steps_list = [
    None,  # Will be skipped
    np.array([0.5, 0.3, 0.2, 0.1]),  # Index 1, f_value ≈ 0.39
    np.array([0.3, 0.2, 0.1, 0.05]),  # Index 2, f_value ≈ 0.155 (better)
    np.array([0.1, 0.05, 0.02, 0.01]),  # Index 3, f_value ≈ 0.0135 (best)
    np.array([0.2, 0.15, 0.1, 0.08]),  # Index 4, f_value ≈ 0.0789 (worse, will stop)
    np.array([1.0, 1.0, 1.0, 1.0]),  # Index 5, not evaluated
]

ARGS = {
    'f': create_target_function(),
    'steps_list': steps_list,
    'verbose': True,
}
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 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
diag_EF_autograd Ran
ran on a synthesized input
ltatzel/PyTorchHessianFree/hessianfree/preconditioners.py
code served (permissive licence) · get_code("24b644f7a82e7733")
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 (23,) 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)

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

# Define a simple loss function
class SimpleLoss(nn.Module):
    def forward(self, outputs, targets):
        # outputs: (2,) or scalar, targets: scalar or (2,)
        if outputs.dim() > 0:
            outputs = outputs.squeeze()
        if targets.dim() > 0:
            targets = targets.squeeze()
        return torch.nn.functional.mse_loss(outputs, targets, reduction='none').mean()

# Create model and loss function
model = SimpleModel()
loss_function = SimpleLoss()

# Create small batch of inputs and targets
# batch size = 2, input dimension = 4, output dimension = 2
inputs = torch.randn(2, 4)
targets = torch.randn(2, 2)

# Set reduction parameter
reduction = "sum"

ARGS = {
    "model": model,
    "loss_function": loss_function,
    "inputs": inputs,
    "targets": targets,
    "reduction": reduction
}
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 (23,) — shape (23,) 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
diag_to_preconditioner Ran
ran on a synthesized input
ltatzel/PyTorchHessianFree/hessianfree/preconditioners.py
code served (permissive licence) · get_code("3a0ede3d2c75311a")
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 function. 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)

# Create a small diagonal vector
diag_vec = torch.tensor([1.0, 2.0, 3.0, 4.0])

# Set damping parameter
damping = 0.1

# Set exponent parameter
exponent = 0.75

ARGS = {
    "diag_vec": diag_vec,
    "damping": damping,
    "exponent": exponent,
}
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 function — a function output has no array shape of its own; none is stated — the instrument coerces any output to an array; for a function 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
simple_linesearch Ran
ran on a synthesized input
ltatzel/PyTorchHessianFree/hessianfree/linesearch.py
code served (permissive licence) · get_code("22f0d7fc2e2bc7dc")
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)

# Define a simple callable function that returns a scalar loss
# f takes a step vector and returns a scalar value
def create_quadratic_function(base_point):
    """Create a simple quadratic function for testing line search."""
    def f(step_vec):
        # Simple quadratic: ||step_vec||^2 + linear term
        loss = torch.sum(step_vec ** 2) + torch.sum(step_vec)
        return float(loss)
    return f

# Create test tensors
step = torch.randn(4)  # Small step vector of dimension 4
f_grad_0 = torch.randn(4)  # Gradient at 0, same dimension as step

# Make f_grad_0 have a negative dot product with step to be a descent direction
f_grad_0 = -torch.abs(f_grad_0)  # Ensure negative components

# Create the function to minimize
f = create_quadratic_function(None)

# Construct ARGS dictionary with all required parameters
ARGS = {
    'f': f,
    'f_grad_0': f_grad_0,
    'step': step,
    'init_alpha': 1.0,
    'beta': 0.8,
    'c': 0.01,
    'max_iter': 20,
    'verbose': False,
}
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
vector_to_parameter_list Ran
ran on a synthesized input
ltatzel/PyTorchHessianFree/hessianfree/utils.py
code served (permissive licence) · get_code("95baf3dc76ee0697")
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 torch.nn as nn

torch.manual_seed(0)

# Create a vector that represents flattened parameters
# We'll create parameters with different shapes to test the function properly
param1 = torch.randn(2, 3)  # 6 elements
param2 = torch.randn(4)      # 4 elements
param3 = torch.randn(2, 2)   # 4 elements
# Total: 14 elements

# Flatten all parameters into a single vector
vec = torch.cat([param1.flatten(), param2.flatten(), param3.flatten()])

# Create parameter list (these should match the shapes we used above)
parameters = [param1, param2, param3]

ARGS = {
    'vec': vec,
    'parameters': parameters
}
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 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
exp_loss Not yet run
unverified (harvested, no recorded run)
tum-pbs/sip/exp/train_exp.py
code served (permissive licence) · get_code("09664ea4315cbbb6")
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, 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 8 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

Solving inverse problems, such as parameter estimation and optimal control, is a vital part of science. Many experiments repeatedly collect data and rely on machine learning algorithms to quickly infer solutions to the associated inverse problems. We find that state-of-the-art training techniques are not well-suited to many problems that involve physical processes. The highly nonlinear behavior, common in physical processes, results in strongly varying gradients that lead first-order optimizers like SGD or Adam to compute suboptimal optimization directions. We propose a novel hybrid training approach that combines higherorder optimization methods with machine learning techniques. We take updates from a scale-invariant inverse problem solver and embed them into the gradientdescent-based learning pipeline, replacing the regular gradient of the physical process. We demonstrate the capabilities of our method on a variety of canonical physical systems, showing that it yields significant improvements on a wide range of optimization and learning problems.

For agents

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

get_harvested_code_for_paper("2109.15048")
get_code_for_paper("2109.15048")
have("2109.15048")

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

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

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

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

Connect an agent — have() is free.