SYNTOLOGY HomeExplorerAtlasCodeMethodologyAboutDevelopersFeedPricing
Paper · 1812.00804 · 2018

Deep Inverse Optimization

arXiv · PDF · Open in the Atlas

Code that ran

7 of 10 samples (functions and classes) lifted from this paper's linked repositories executed on a synthesized input in Syntology's jail (0 of them constructed an object rather than computing a result; 0 honoured the contract we drafted, 0 violated it and 7 have no contract verdict; 0 failures of our instrument; 3 no recorded run), measured 2026-11-22; repository links from the Papers with Code archive attributed under CC BY-SA, no affiliation; bodies inline only under a permissive licence as GitHub detects it. Not a reproduction of the paper's results.

"Ran" means the function executed on a synthesized input and returned a value. It is not a reproduction of the paper's results. This record, dated, as JSON: /api/ran/1812.00804.json · badge: /api/ran/1812.00804.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
tankconcordia/deep_inv_opt community (classifier label)
classifier basis not recorded on the link
7 ran · 3 no recorded run
FunctionStatusWhere it lives
build_tensor Ran
ran on a synthesized input
tankconcordia/deep_inv_opt/deep_inv_opt/util.py
code served (permissive licence) · get_code("ed18467075f16d79")
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, 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 torch

torch.manual_seed(0)

# Test case 1: list of lists with mixed tensors and scalars
a = torch.tensor([1.5], dtype=torch.float64, requires_grad=True)
b = torch.tensor([3.0], dtype=torch.float64, requires_grad=True)

x = [[a*b, 6.0],
     [0.0, a+1]]

ARGS = {
    "x": x
}
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, 2) — shape (2, 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
inverse_linprog_step_printer Ran
ran on a synthesized input
tankconcordia/deep_inv_opt/deep_inv_opt/linprog.py
code served (permissive licence) · get_code("6c394ddf09fb6bda")
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 numpy as np

def as_numpy(x):
    """Helper function to convert input to numpy array."""
    if isinstance(x, np.ndarray):
        return x
    return np.array(x)

ARGS = {
    'want_constraints': False,
}
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 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
inverse_parametric_linprog_step_printer Ran
ran on a synthesized input
tankconcordia/deep_inv_opt/deep_inv_opt/parametric.py
code served (permissive licence) · get_code("08c3ee167ff1f270")
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
import numpy as np

torch.manual_seed(0)

def as_str(*args, flat=False):
    """Helper function that matches the usage in the callback."""
    if flat:
        return [str(arg) for arg in args]
    return str(args)

# Create mock objects for the callback parameters
u_sample = [torch.randn(2, 4), torch.randn(2, 4)]
x_sample = [torch.randn(2, 3), torch.randn(2, 3)]

def f_mock(u_input):
    """Mock function that takes u and returns f values."""
    return (torch.randn(2, 5), torch.randn(2, 5))

ARGS = {
    'want_details': 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 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
is_feasible Ran
ran on a synthesized input
tankconcordia/deep_inv_opt/deep_inv_opt/util.py
code served (permissive licence) · get_code("d414607a77420000")
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 bool, 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 numpy as np

# The function checks if A_ub @ x <= b_ub + tolerance
# We need:
# - x: a 1D array (solution vector)
# - A_ub: a 2D array (constraint matrix)
# - b_ub: a 1D array (constraint bounds)
# - tolerance: a float (default 0.0)

# Create small, distinct dimensions
# Let x be dimension 4 (4 variables)
# Let A_ub be 2x4 (2 constraints on 4 variables)
# Let b_ub be dimension 2 (2 constraint bounds)

x = np.array([1.0, 2.0, 0.5, 1.5])

A_ub = np.array([
    [1.0, 1.0, 0.0, 0.0],  # constraint 1
    [0.0, 1.0, 1.0, 1.0]   # constraint 2
])

b_ub = np.array([5.0, 6.0])

tolerance = 0.1

ARGS = {
    'x': x,
    'A_ub': A_ub,
    'b_ub': b_ub,
    'tolerance': tolerance
}
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 bool, 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
linprog_path_plotter Ran
ran on a synthesized input
tankconcordia/deep_inv_opt/deep_inv_opt/plot.py
code served (permissive licence) · get_code("dcda38761280a243")
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 numpy as np
import matplotlib.pyplot as plt

# Define a minimal as_numpy function that the code imports/uses
def as_numpy(*args):
    """Convert arguments to numpy arrays."""
    result = []
    for arg in args:
        if arg is None:
            result.append(None)
        elif isinstance(arg, np.ndarray):
            result.append(arg)
        else:
            result.append(np.asarray(arg))
    return result

def _collect_linprog_central_path(step, c, A_ub, b_ub, A_eq, b_eq, x, dx, t):
    """Stub function for collecting central path."""
    return []

# Setup valid arguments for linprog_path_plotter
ARGS = {
    'xylim': ((-1, 10), (-1, 10)),
    'title': 'Linear Programming Path'
}
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 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
linprog_step_plotter Ran
ran on a synthesized input
tankconcordia/deep_inv_opt/deep_inv_opt/plot.py
code served (permissive licence) · get_code("3f6d9c05e8a23adf")
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 numpy as np
import matplotlib.pyplot as plt

# Define as_numpy function that the code calls
def as_numpy(*args):
    """Convert arguments to numpy arrays."""
    result = []
    for arg in args:
        if arg is None:
            result.append(None)
        elif isinstance(arg, np.ndarray):
            result.append(arg)
        else:
            result.append(np.array(arg))
    return result

# Create simple test data for a linear programming problem
# We need:
# - c: objective function coefficients (2D for plotting)
# - A_ub: inequality constraint matrix
# - b_ub: inequality constraint bounds
# - A_eq: equality constraint matrix (optional)
# - b_eq: equality constraint bounds (optional)
# - xylim: optional axis limits
# - title: optional title string

c = np.array([1.0, 2.0])
A_ub = np.array([
    [1.0, 1.0],
    [2.0, 1.0],
    [-1.0, 0.0]
])
b_ub = np.array([5.0, 8.0, 0.0])
A_eq = None
b_eq = None
xylim = ((-1, 10), (-1, 10))
title = "Linear Programming Problem"

ARGS = {
    'xylim': xylim,
    'title': title
}
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 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
tensor Ran
ran on a synthesized input
tankconcordia/deep_inv_opt/deep_inv_opt/util.py
code served (permissive licence) · get_code("5311ce7af258b366")
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 'data' as the first positional argument
# and accepts **kwargs which are passed to torch.DoubleTensor

# Create a simple data structure for the tensor
data = [[1.0, 2.0, 3.0, 4.0], [5.0, 6.0, 7.0, 8.0]]

ARGS = {
    "data": data,
}
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
linprog Not yet run
unverified (harvested, no recorded run)
tankconcordia/deep_inv_opt/deep_inv_opt/linprog.py
code served (permissive licence) · get_code("080ed0b92af94f1d")
How it ran

no invocation recorded.

linprog_feasible Not yet run
unverified (harvested, no recorded run)
tankconcordia/deep_inv_opt/deep_inv_opt/linprog.py
code served (permissive licence) · get_code("957f01dde2615cd1")
How it ran

no invocation recorded.

plot_linprog Not yet run
unverified (harvested, no recorded run)
tankconcordia/deep_inv_opt/deep_inv_opt/plot.py
code served (permissive licence) · get_code("b8473d99d414961b")
How it ran

no invocation recorded.

Also present in other papers' code

Of 10 samples lifted from this paper's linked repositories, 10 carry a function identity and 0 do not. Of the 10 distinct functions with an identity, 0 are also present in other papers whose code we hold (0 with at least one paper dated earlier, 0 the same month, 0 later) and 10 are only here among the 52,977 papers whose code Syntology holds (as of 2026-09-26).

Only here means: among the 52,977 papers whose code Syntology holds (51,887 with lifted samples, 1,090 through their assemblies only), as of 2026-09-26, no other paper's lifted samples or current assembly bricks contain an identical function body after normalisation.

Presence, not direction: an identical function body in two papers' repositories does not say who wrote it, which came from which, or that either paper's method rests on it. Matching is exact after normalisation, so a renamed or edited function is not matched. Dates are when papers appeared, not when code was written. Only .py files the harvester lifted are covered; notebooks are not read. A new-style arXiv id YYMM.NNNN dates a paper to the month 20YY-MM; otherwise Paper.year dates it to the year; otherwise it is undated. Dates are when the paper appeared, not when the code was written. Read 2026-11-22.

Repositories linked to this paper

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

Abstract

Given a set of observations generated by an optimization process, the goal of inverse optimization is to determine likely parameters of that process. We cast inverse optimization as a form of deep learning. Our method, called deep inverse optimization, is to unroll an iterative optimization process and then use backpropagation to learn parameters that generate the observations. We demonstrate that by backpropagating through the interior point algorithm we can learn the coefficients determining the cost vector and the constraints, independently or jointly, for both non-parametric and parametric linear programs, starting from one or multiple observations. With this approach, inverse optimization can leverage concepts and algorithms from deep learning.

For agents

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

get_harvested_code_for_paper("1812.00804")
get_code_for_paper("1812.00804")
have("1812.00804")

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

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

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

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

Connect an agent — have() is free.