Mlpack: Please support at least one standard ML model format

Created on 8 May 2020  路  5Comments  路  Source: mlpack/mlpack

Here https://github.com/mlpack/mlpack/blob/master/src/mlpack/core/data/load_model_impl.hpp#L46 the Load function can only load .xml, .bin and .txt files.

Please consider adding the TfLite format which can easily be opened in various programs and converted to other formats.

The TfLite format can be read and written using just one header tflite_schema_generated.h that is generated with the flatc (FlatBuffers) compiler from the TfLite's .fbs definition file.

question

All 5 comments

Hi @yurivict, thanks for the input. The TFLite format is limited to (a limited subset of) neural network architectures. mlpack supports way more than that---for many model types and object types in mlpack, there is no way to save them using the TFLite format. So unfortunately we can't really do this; it's apples and oranges.

However, there is a TensorFlow translator prototype here: https://github.com/sreenikSS/mlpack-Tensorflow-Translator . Maybe that could be helpful; it's meant to provide interoperability between the part of mlpack that's focused on neural networks and other toolkits. (It's still under development though.)

Thank you for this information!

Could you provide an example of a feature supported in mlpack that isn't supported in TFLite?

Literally every single model on this page:

https://www.mlpack.org/doc/mlpack-3.3.1/cli_documentation.html

It might be possible to implement some of these in TensorFlow (after all, it is a generic linear algebra framework). However, they will have nowhere near the efficiency of the algorithms and data structures used in mlpack---so, e.g., there is no clear way to make TensorFlow compute k-nearest-neighbors in the way that mlpack does, and though you can use TensorFlow to compute k-nearest-neighbors (inefficiently), the data stored in the mlpack kNN model (a tree structure) can't be used in TensorFlow.

Another note is that because TensorFlow is a generic linear algebra language, writing a converter from mlpack models and algorithms to TensorFlow essentially amounts to reimplementing the entire library but now with TensorFlow as a backend...

Hope this helps.

Thank you for your explanation.

Of course, happy to help out. :+1:

Was this page helpful?
0 / 5 - 0 ratings

Related issues

u8sand picture u8sand  路  6Comments

FloopCZ picture FloopCZ  路  6Comments

zoq picture zoq  路  6Comments

brightprogrammer picture brightprogrammer  路  4Comments

YaweiZhao picture YaweiZhao  路  4Comments