process-intelligence-research / ReLU_ANN_MILP

With this package, you can generate mixed-integer linear programming (MIP) models of trained artificial neural networks (ANNs) using the rectified linear unit (ReLU) activation function. At the moment, only TensorFlow sequential models are supported. Interfaces to either the Pyomo or Gurobi modeling environments are offered.
MIT License
56 stars 7 forks source link

Are CNN models possible to embed? #1

Open fainalo4 opened 4 months ago

fainalo4 commented 4 months ago

Hi, are CNN sequential models from Keras supported? For example if I insert a Keras "Conv2D" layer in the model, is the linearity of the model preserved and thus the possibility to embed in a MILP model?

llueg commented 4 months ago

Hi, this package only supports dense relu layers. If you're using pyomo, I would look into the OMLT (https://github.com/cog-imperial/OMLT) package -they support a variety of layers and activations, including CNNs.