rstudio / vetiver-python

Version, share, deploy, and monitor models.
https://rstudio.github.io/vetiver-python/stable/
MIT License
58 stars 18 forks source link

Request to develop Model Handler for Tensorflow/Keras #213

Open jnhyeon opened 2 months ago

jnhyeon commented 2 months ago

Thank you for creating and sharing a good package. I would like you to develop a Model Handler for Tensorflow/Keras.

Thank you :)

isabelizimm commented 1 month ago

Hello there! Thank you for opening this issue and enjoying vetiver πŸ‘‹

Before I look at a solution, are you able to give me a little more context on what models you are using and what the data looks like? I want to make sure I understand what users are doing and solve the right problem.

In the meantime, there are custom handlers that may make it possible to serve Tensorflow models currently.

jnhyeon commented 1 month ago

I know that Posit (Rstudio) officially distributes tensorflow and keras packages. Therefore, I think that vetiver should officially create a more powerful tensorflow (keras) related API before scikit-learn or pytorch.

Maybe it's because my Python programming skills aren't high enough to write a custom Handler.

I would be grateful if you could create a Handler for tensorlfow (keras). Even if not, I will create a custom Handler using the method you suggested.

Thank you

isabelizimm commented 1 month ago

I'm open to creating a Tensorflow handler, especially since the R version of vetiver already has keras support.

I'm particularly interested in the use case of the TensorFlow model you are using; eg, is it a model you're building in keras, like an image classification model, something from TensorFlow's pre-trained model garden, or something different? After a quick look, it seems like keras and TensorFlow may require separate handlers, and there are lots of TensorFlow extensions that would likely need slight accommodations in how a predict method would be called. Knowing what use cases are important to you helps me to prioritize what sort of support is needed πŸ™‚

jnhyeon commented 1 month ago

Thank you for your attention.

I am developing an LSTM-based prediction model that predicts waveforms by adjusting control values.

Plastic molding is performed by adjusting the injection speed or injection pressure in injection mold equipment, and the quality of the product can be indirectly known through the pressure waveform within the mold.

The final goal is to create a system that recommends control values ​​to obtain the desired waveform using an optimization algorithm after creating a prediction model.

I plan to use Vetiver to perform machine learning every four months. Since the temperature in the factory is related to the season, machine learning is needed for each season.

My case is as above.

Thank you πŸ™‚