dmlc / keras

Deep Learning library for Python. Convnets, recurrent neural networks, and more. Runs on MXNet, Theano or TensorFlow.
http://keras.io/
Other
125 stars 34 forks source link

Support exporting MXNet model (symbol, params) from Keras model #98

Closed ndeepesh closed 6 years ago

ndeepesh commented 6 years ago

Adding support to save the model as MXNet model (sym, params). This allows users to train using Keras interface with MXNet backend, export the model as MXNet model, use native MXNet for inference. Users can also use any language binding of MXNet ex: Python/Scala/C++ for inference.

Adding two API's

  1. get_mxnet_model(model, bucket) - Extracts MXNet module and Symbol (extracted symbol depends on the bucket passed in. So if 'train' bucket is passed then it would return the symbol bind to training)
  2. save_mxnet_model(model, bucket) - Same as get_mxnet_model excepts it saves the Symbol and Params to a files

Testing Done

  1. Created dummy sequential lstm model in keras and inferred with MXNet
  2. Created dummy functional api model in keras and inferred with MXNet