Skip to main content

PyTorch/JAX-based End-to-End Predict-then-Optimize Tool

Project description

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, COPT, Pyomo, Google OR-Tools, 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 autograd modules.

Features

  • Implement SPO+, PG, DPO (additive and multiplicative perturbations), PFYL (additive and multiplicative perturbations), I-MLE, AI-MLE, L2-regularized RFWO/RFYL, DBB, NID, CaVE, NCE, and LTR
  • Support Gurobi, COPT, Pyomo, Google OR-Tools, and MPAX API
  • Symbolic modeling with pyepo.dsl: define an LP, MIP, or QP once, then compile it to any backend
  • JAX frontend (pyepo.func.jax): train any loss in JAX/Flax with jax.grad
  • Support parallel computing for optimization solvers
  • Support solution caching to speed up training
  • Support kNN robust loss to improve decision quality

CaVE for Binary Linear Programs

For end-to-end learning on binary linear programs (TSP, CVRP, knapsack, ...), PyEPO ships CaVE. CaVE replaces the per-step ILP solve with a cone-alignment projection onto the binding-constraint normals at the true optimum, backed by an interior-point QP solver (Clarabel). Because the cone projection is far cheaper than the per-instance ILP solve, CaVE trains an order of magnitude faster than SPO+ at TSP scale.

GPU-Accelerated Solving with MPAX

PyEPO integrates 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.

Publication

PyEPO: A PyTorch-based End-to-End Predict-then-Optimize Library for Linear and Integer Programming (Mathematical Programming Computation)

Project details


Download files

Download the file for your platform. If you're not sure which to choose, learn more about installing packages.

Source Distribution

pyepo-2.2.6.tar.gz (164.5 kB view details)

Uploaded Source

Built Distribution

If you're not sure about the file name format, learn more about wheel file names.

pyepo-2.2.6-py3-none-any.whl (162.3 kB view details)

Uploaded Python 3

File details

Details for the file pyepo-2.2.6.tar.gz.

File metadata

  • Download URL: pyepo-2.2.6.tar.gz
  • Upload date:
  • Size: 164.5 kB
  • Tags: Source
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyepo-2.2.6.tar.gz
Algorithm Hash digest
SHA256 b76d4a916215f970a5646b0ca31b32944330f24ed1d565427b7142095a0d5172
MD5 ae9bf1b4e55f8d3f2da5b8713ba22329
BLAKE2b-256 a58e4edd74d841fb41cb4b533e38ef5d53dc82bbaea746e6eca949eba3ed3175

See more details on using hashes here.

File details

Details for the file pyepo-2.2.6-py3-none-any.whl.

File metadata

  • Download URL: pyepo-2.2.6-py3-none-any.whl
  • Upload date:
  • Size: 162.3 kB
  • Tags: Python 3
  • Uploaded using Trusted Publishing? No
  • Uploaded via: twine/6.1.0 CPython/3.13.12

File hashes

Hashes for pyepo-2.2.6-py3-none-any.whl
Algorithm Hash digest
SHA256 bcbdc9cb99b61a06526317b73229de3266cef8f8464e8db89d3029d816f466c4
MD5 a82e396994e5822dbe0e29f87a168926
BLAKE2b-256 b0e49fc2a74d3f217ac4f4e3efd3b5e46e26ecf3ff4c8dd21019f9ccdfb4a194

See more details on using hashes here.

Supported by

AWS Cloud computing and Security Sponsor Datadog Monitoring Depot Continuous Integration Fastly CDN Google Download Analytics Pingdom Monitoring Sentry Error logging StatusPage Status page