Closed wangyexiang closed 1 year ago
Based on the error I think your problem is that the model coming back from tensorflow is using intrinsic functions coming from Python or Numpy instead of the ones provided by Pyomo. You need to either convert the model to explicit Pyomo expression trees or treat the model as an external function/blackbox. I think there are some general tools under development for doing exactly this but I'm not sure if they have been released yet.
treat the model as an external function/blackbox.
Dear sir, Thank for your reply. Is external function/blackbox mean pyomo.core.expr.current.ExternalFunction
? If yes, could you give me an example about how to use ExternalFunction
API to optimize a machine learning model?Thanks in advance!@blnicho
@wangyexiang there is a new package out called OMLT for representing machine learning models within a Pyomo model. You can find it here: https://github.com/cog-imperial/OMLT
Thanks in advance!