cog-imperial / OMLT

Represent trained machine learning models as Pyomo optimization formulations
Other
273 stars 58 forks source link

Layer formulation #24

Closed carldlaird closed 2 years ago

carldlaird commented 2 years ago

This PR merges work from many different people.

The key item added was @fracek reworking of the network definition to include individual objects for layers and to allow for multi-dimensional inputs and outputs. It also includes reworking of other parts of the code to update them to this new foundation.

This also added gbt and some preliminary implementations of different notebooks.

codecov[bot] commented 2 years ago

Codecov Report

Merging #24 (56845c8) into main (2c38689) will decrease coverage by 2.30%. The diff coverage is 89.27%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #24      +/-   ##
==========================================
- Coverage   91.10%   88.79%   -2.31%     
==========================================
  Files          15       23       +8     
  Lines         854     1071     +217     
  Branches      159      160       +1     
==========================================
+ Hits          778      951     +173     
- Misses         51       98      +47     
+ Partials       25       22       -3     
Impacted Files Coverage Δ
src/omlt/io/onnx.py 47.61% <38.88%> (-44.78%) :arrow_down:
src/omlt/neuralnet/layers/full_space.py 60.60% <60.60%> (ø)
src/omlt/neuralnet/layer.py 73.33% <73.33%> (ø)
src/omlt/neuralnet/network_definition.py 89.65% <88.46%> (-4.99%) :arrow_down:
src/omlt/io/onnx_parser.py 93.16% <93.16%> (ø)
src/omlt/neuralnet/nn_formulation.py 95.31% <95.31%> (ø)
src/omlt/neuralnet/activations/relu.py 96.77% <96.77%> (ø)
src/omlt/block.py 100.00% <100.00%> (+7.27%) :arrow_up:
src/omlt/formulation.py 92.06% <100.00%> (+3.82%) :arrow_up:
src/omlt/gbt/__init__.py 100.00% <100.00%> (ø)
... and 13 more

Continue to review full report at Codecov.

Legend - Click here to learn more Δ = absolute <relative> (impact), ø = not affected, ? = missing data Powered by Codecov. Last update 2c38689...56845c8. Read the comment docs.