cog-imperial / OMLT

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

Partition based formulation #35

Closed fracek closed 2 years ago

fracek commented 2 years ago

This PR adds partition based formulations for dense nodes. I marked it as draft because I will need to rename things after #33 is merged.

codecov[bot] commented 2 years ago

Codecov Report

Merging #35 (41d078a) into main (7e6363a) will increase coverage by 1.42%. The diff coverage is 93.10%.

Impacted file tree graph

@@            Coverage Diff             @@
##             main      #35      +/-   ##
==========================================
+ Coverage   89.72%   91.14%   +1.42%     
==========================================
  Files          23       24       +1     
  Lines        1090     1231     +141     
  Branches      163      186      +23     
==========================================
+ Hits          978     1122     +144     
+ Misses         90       80      -10     
- Partials       22       29       +7     
Impacted Files Coverage Δ
src/omlt/neuralnet/__init__.py 100.00% <ø> (ø)
src/omlt/neuralnet/layer.py 73.91% <66.66%> (+0.57%) :arrow_up:
src/omlt/neuralnet/nn_formulation.py 92.92% <92.30%> (-0.25%) :arrow_down:
src/omlt/neuralnet/layers/partition_based.py 94.02% <94.02%> (ø)
src/omlt/io/onnx_parser.py 95.00% <100.00%> (+1.83%) :arrow_up:
src/omlt/io/onnx.py 85.71% <0.00%> (+38.09%) :arrow_up:

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 7e6363a...41d078a. Read the comment docs.

jalving commented 2 years ago

@fracek PR #33 has been merged. Let me know when this is ready for review.

jalving commented 2 years ago

@fracek PR #40 is merged. We can try re-running tests now.

jalving commented 2 years ago

One of the CI jobs failed because of a time-out. Some of the Cbc solves can take quite awhile. We can either continue to reduce neural network size, or we can probably get away with a longer notebook time-out.

See Issue https://github.com/cog-imperial/OMLT/issues/42

fracek commented 2 years ago

Looks like now they're all passing. The PR is all done.