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

Underlying MXNet Model Extraction #85

Open joeddav opened 7 years ago

joeddav commented 7 years ago

It would be beneficial to have a way to extract the underlying MXNet module, similar to how a user can call K.get_session() with the TensorFlow backend. The global _MODEL object is unaccessible via API, so there's no way I can see to access the MXNet module.

In my own fork I have added the following to mxnet_backend.py:

def get_mxnet_module():
    return _MODEL._mod

Please let me know if there's a better way to do it. If not, I'd be happy to submit a PR with the above as I believe that feature would be useful to others as well.