Metadata-Version: 2.4
Name: pyepo
Version: 1.3.3
Summary: PyTorch-based End-to-End Predict-then-Optimize Tool
Author-email: Bo Tang <bolucas.tang@mail.utoronto.ca>
License: MIT
Project-URL: Homepage, https://github.com/khalil-research/PyEPO
Project-URL: Documentation, https://khalil-research.github.io/PyEPO
Project-URL: Repository, https://github.com/khalil-research/PyEPO
Project-URL: Issues, https://github.com/khalil-research/PyEPO/issues
Project-URL: Paper, https://link.springer.com/article/10.1007/s12532-024-00255-x
Keywords: predict-then-optimize,end-to-end,decision-focused learning,optimization,deep learning,pytorch,linear programming,integer programming
Classifier: Programming Language :: Python :: 3
Classifier: Programming Language :: Python :: 3.9
Classifier: Programming Language :: Python :: 3.10
Classifier: Programming Language :: Python :: 3.11
Classifier: Programming Language :: Python :: 3.12
Classifier: Programming Language :: Python :: 3.13
Classifier: Operating System :: OS Independent
Classifier: License :: OSI Approved :: MIT License
Classifier: Topic :: Scientific/Engineering :: Artificial Intelligence
Classifier: Topic :: Scientific/Engineering :: Mathematics
Classifier: Intended Audience :: Science/Research
Classifier: Typing :: Typed
Requires-Python: >=3.9
Description-Content-Type: text/markdown
License-File: LICENSE
Requires-Dist: numpy
Requires-Dist: scipy
Requires-Dist: pathos
Requires-Dist: tqdm
Requires-Dist: scikit_learn
Requires-Dist: torch>=1.13.1
Provides-Extra: pyomo
Requires-Dist: pyomo>=6.1.2; extra == "pyomo"
Provides-Extra: gurobi
Requires-Dist: gurobipy>=9.1.2; extra == "gurobi"
Provides-Extra: copt
Requires-Dist: coptpy; extra == "copt"
Provides-Extra: ortools
Requires-Dist: ortools>=9.6; extra == "ortools"
Provides-Extra: mpax
Requires-Dist: mpax; extra == "mpax"
Requires-Dist: jax>=0.4.1; extra == "mpax"
Requires-Dist: jaxlib>=0.4.1; extra == "mpax"
Provides-Extra: autosklearn
Requires-Dist: auto-sklearn; extra == "autosklearn"
Requires-Dist: configspace; extra == "autosklearn"
Provides-Extra: all
Requires-Dist: pyomo>=6.1.2; extra == "all"
Requires-Dist: gurobipy>=9.1.2; extra == "all"
Requires-Dist: coptpy; extra == "all"
Requires-Dist: ortools>=9.6; extra == "all"
Requires-Dist: mpax; extra == "all"
Requires-Dist: jax>=0.4.1; extra == "all"
Requires-Dist: jaxlib>=0.4.1; extra == "all"
Provides-Extra: dev
Requires-Dist: pytest; extra == "dev"
Requires-Dist: ruff; extra == "dev"
Requires-Dist: pyright; extra == "dev"
Provides-Extra: docs
Requires-Dist: sphinx>=7; extra == "docs"
Requires-Dist: sphinx-autoapi>=3; extra == "docs"
Requires-Dist: furo>=2024.1; extra == "docs"
Dynamic: license-file

# PyEPO: A PyTorch-based End-to-End Predict-then-Optimize Tool

``PyEPO`` (PyTorch-based End-to-End Predict-then-Optimize Tool) is a Python-based, open-source software that supports modeling and solving predict-then-optimize problems with linear objective functions. The core capability of ``PyEPO`` is to build optimization models with [GurobiPy](https://www.gurobi.com/), [COPT](https://shanshu.ai/copt), [Pyomo](http://www.pyomo.org/), [Google OR-Tools](https://developers.google.com/optimization), [MPAX](https://github.com/MIT-Lu-Lab/MPAX), or any other solvers and algorithms, then embed the optimization model into an artificial neural network for the end-to-end training. For this purpose, ``PyEPO`` implements various methods as [PyTorch](https://pytorch.org/) autograd modules.

## Features

- Implement **SPO+**, **DBB**, **NID**, **DPO** (additive and multiplicative perturbations), **PFYL** (additive and multiplicative perturbations), L2-regularized **RFWO/RFYL**, **NCE**, **LTR**, **I-MLE**, **AI-MLE**, and **PG**
- Support [Gurobi](https://www.gurobi.com/), [COPT](https://shanshu.ai/copt), [Pyomo](http://www.pyomo.org/), [Google OR-Tools](https://developers.google.com/optimization), and [MPAX](https://github.com/MIT-Lu-Lab/MPAX) API
- Support parallel computing for optimization solvers
- Support solution caching to speed up training
- Support kNN robust loss to improve decision quality

## GPU-Accelerated Solving with MPAX

``PyEPO`` integrates [MPAX](https://github.com/MIT-Lu-Lab/MPAX), a JAX-based mathematical programming solver using the PDHG algorithm for GPU-accelerated optimization. Key advantages: (1) **GPU-native solving** — the first-order PDHG method runs efficiently on GPU; (2) **batch solving** — an entire mini-batch can be solved simultaneously via vectorization; (3) **no GPU-CPU data transfer overhead** — both the neural network and the solver stay on GPU, eliminating the data transfer bottleneck.

## Documentation

The official docs can be found at [https://khalil-research.github.io/PyEPO](https://khalil-research.github.io/PyEPO).

## Publication

[PyEPO: A PyTorch-based End-to-End Predict-then-Optimize Library for Linear and Integer Programming](https://link.springer.com/article/10.1007/s12532-024-00255-x) (Mathematical Programming Computation)
