idaes-pse icon indicating copy to clipboard operation
idaes-pse copied to clipboard

Adds ONNX Surrogate support from OMLT

Open avdudchenko opened this issue 1 year ago • 8 comments
trafficstars

Fixes

This adds ONNX surrogate model object and slightly refactors the current Keras surrogate model to support multiple omlt model types.

Summary/Motivation:

Currently, if one generates a NN model using PyTorch, or any other method for use in IDAES and depended project (e.g. WaterTAP) we must export the model to ONNX format, and then to keras format to use in IDAES, which makes little sense.

This PR adds native support to onnx model format provided through OMLT.

Changes proposed in this PR:

-move out part of Keras functions into omlt_surrogate_base.py to enable simple support for multiple omlt import types -adds ONNXSurrogate object that can load onnx model directly in IDAES flowsheet block

Legal Acknowledgement

By contributing to this software project, I agree to the following terms and conditions for my contribution:

  1. I agree my contributions are submitted under the license terms described in the LICENSE.txt file at the top level of this directory.
  2. I represent I am authorized to make the contributions and grant the license. If my employer has rights to intellectual property that includes these contributions, I represent that I have received permission to make contributions and grant the required license on behalf of that employer.

avdudchenko avatar Dec 21 '23 02:12 avdudchenko