MathOptAI.jl: Embed trained machine learning predictors into JuMP models

Oscar Dowson, Robert B Parker, Russel Bent
7/3/2025
cs.LGmath.OC

Official code: lanl-ansi/MathOptAI.jl (82 stars, last commit 2026-04-02).

Abstract

We present \texttt{MathOptAI.jl}, an open-source Julia library for embedding trained machine learning predictors into a JuMP model. \texttt{MathOptAI.jl} can embed a wide variety of neural networks, decision trees, and Gaussian Processes into a larger mathematical optimization model. In addition to interfacing a range of Julia-based machine learning libraries such as \texttt{Lux.jl} and \texttt{Flux.jl}, \texttt{MathOptAI.jl} uses Julia's Python interface to provide support for PyTorch models. When the PyTorch support is combined with \texttt{MathOptAI.jl}'s gray-box formulation, the function, Jacobian, and Hessian evaluations associated with the PyTorch model are offloaded to the GPU in Python, while the rest of the nonlinear oracles are evaluated on the CPU in Julia. \MathOptAI is available at https://github.com/lanl-ansi/MathOptAI.jl under a BSD-3 license.

View on arXivView PDF

Code Implementations(1)

Embed trained machine learning predictors into JuMP and ExaModels

825JuliaMay 6, 20246 months agoNOASSERTION
artificial-intelligencejump-jlmachine-learningneural-networksoptimization

Cite this paper

@article{dowson2025mathoptaijl,
  title  = {MathOptAI.jl: Embed trained machine learning predictors into JuMP models},
  author = {Oscar Dowson and Robert B Parker and Russel Bent},
  year   = {2025},
  eprint = {2507.03159},
  archivePrefix = {arXiv},
  url    = {http://arxiv.org/abs/2507.03159v1}
}

Add a badge to your README

Shows whether official code is linked for this paper.

Code of Paper badge
[![Code of Paper](https://codeofpaper.com/badge/2507.03159.svg)](https://codeofpaper.com/paper/2507.03159)

Discussion