-
Notifications
You must be signed in to change notification settings - Fork 51
Add some support of ONNX through codex #444
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
base: main
Are you sure you want to change the base?
Conversation
|
Pierre Bonami seems not to be a GitHub user. You need a GitHub account to be able to sign the CLA. If you have already a GitHub account, please add the email address used for this commit to your account. You have signed the CLA already but the status is still pending? Let us recheck it. |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Pull Request Overview
This PR adds support for ONNX (Open Neural Network Exchange) models to gurobi-ml, enabling formulation of ONNX-based neural networks into Gurobi optimization models. The implementation focuses on sequential multi-layer perceptrons with Gemm/MatMul operations and ReLU activations, consistent with existing Keras and PyTorch support.
Key changes:
- New ONNX module with model parsing and constraint generation
- Test infrastructure for ONNX formulations and cross-framework equivalence testing
- Documentation updates and example notebook demonstrating adversarial attacks with ONNX models
Reviewed Changes
Copilot reviewed 12 out of 14 changed files in this pull request and generated 2 comments.
Show a summary per file
| File | Description |
|---|---|
| tox.ini | Added ONNX test environments and dependencies to the test matrix |
| tests/test_onnx/test_onnx_formulations.py | Test cases for ONNX model formulations using Gemm and MatMul operations |
| tests/test_onnx/test_onnx_exceptions.py | Tests for unsupported ONNX operations |
| tests/test_composite/test_framework_onnx_equivalence.py | Cross-framework tests verifying ONNX conversions produce equivalent results |
| src/gurobi_ml/registered_predictors.py | Registered ONNX convertor with predictor registry |
| src/gurobi_ml/onnx/onnx_model.py | Core implementation of ONNX model parsing and Gurobi formulation |
| src/gurobi_ml/onnx/init.py | ONNX module initialization and exports |
| requirements.onnx.txt | ONNX package dependencies |
| notebooks/adversarial/adversarial_onnx.ipynb | Example notebook demonstrating adversarial attacks using ONNX |
| docs/source/user/supported.rst | Documentation for ONNX support |
| docs/source/index.rst | Updated framework list to include ONNX |
| docs/source/api.rst | Added ONNX API documentation section |
💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.
Co-authored-by: Copilot <[email protected]>
Co-authored-by: Copilot <[email protected]>
No description provided.