cog-imperial / OMLT

Represent trained machine learning models as Pyomo optimization formulations
Other
262 stars 57 forks source link

relu formulation needs relationship between zhat and q #16

Closed michaelbynum closed 2 years ago

michaelbynum commented 2 years ago

This PR adds the constraints

zhat >= q * M
zhat <= (1-q) * M

to the ReLU formulation. Currently, there is nothing relating zhat to q, only z to q. As a result, zhat can be positive, and q can be 0 or 1.

michaelbynum commented 2 years ago

Actually, only the second constraint is needed. I will fix it.

michaelbynum commented 2 years ago

Sorry, this is only a problem with the PyPI release.