../_images/logo1.png

Introduction

PyEPO (PyTorch-based End-to-End Predict-then-Optimize Tool) is a Python library for modeling and solving predict-then-optimize problems with linear objective functions.

PyEPO allows users to build optimization models with GurobiPy, COPT, Pyomo, Google OR-Tools, MPAX, or any custom solver, and embed them into neural networks for end-to-end training. It provides a collection of decision-focused learning methods – including SPO+ loss, differentiable black-box optimizers, perturbed optimizers, Fenchel-Young loss, contrastive losses, learning-to-rank losses, and perturbation gradient – implemented as PyTorch autograd modules.

End-to-End Predict-then-Optimize Framework

Given a labeled dataset \(\mathcal{D}\) of feature-cost pairs \((x,c)\) or feature-solution pairs \((x,w)\), a neural network is trained to directly minimize the decision error, rather than the prediction error of cost coefficients.

../_images/e2e.png