Package: tiledb-ml
TileDB-MLTileDB-ML is the repository that contains all machine learning oriented functionality TileDB supports. In this repo, we explain how someone can employ
TileDB for machine learning oriented data management problems, and which are the next steps we have in mind. Here, we would firstly like to highlight our
perspective on the relation of TileDB with general machine learning oriented data management problems and how TileDB engine could be the solution for
efficiently storing any kind of machine learning data, i.e., from raw images, text, audio, time series and SAR to features and machine learning models.
Before you proceed further, please take a quick look on ourmedium blog post,
which targets to explain in great detail how TileDB addresses many machine learning data format requirements, overcoming the drawbacks of the other
candidate formats, and take this opportunity to solicit feedback and contributions from the community.DescriptionAs mentioned above, this repository contains all machine learning oriented functionality TileDB supports. Specifically, code that
can (or will be able to):Savemachine learning models as TileDB arrays (At the moment we provide implementations for saving Tensorflow Keras, PyTorch and Scikit-Learn models.)Loadmachine learning models from TileDB arrays.Readfeatures, in order to train machine learning models, from TileDB arrays directly to machine learning framework's data APIs.
We alreadysupportthe Tensorflow and PyTorch
data APIs with the use of Python generators for Dense and Sparse TileDB arrays, and we are similarly working on Scikit-Learn
Pipelines which will be out soon.ExamplesWe provide some detailed notebook examples on how to save and load machine learning models as TileDB arrays (also on TileDB-Cloud) and explain why
this is useful in order to create simple and flexible model registries with TileDB.Example for Tensorflow Keras ModelsExample for PyTorch ModelsExample for Scikit-Learn ModelsExample for Tensorflow Model on TileDB-CloudExample for PyTorch Model on TileDB-CloudExample for Scikit-Learn Model on TileDB-CloudWe also provide detailed notebook examples on how to train Tensorflow and PyTorch models with the use of our Data APIs support for Dense TileDB arrays.Example on training wih Tensorflow and Dense TileDB arraysExample on training wih PyTorch and Dense TileDB arraysFinally, we also provide anEnd-To-End exampleon how to ingest data, train a PyTorch model and serve it with UDFs completely serverlessly on TileDB-Cloud.InstallationTileDB-ML can be installed:Quick Installationfrom source by cloning theGitrepository:git clone https://github.com/TileDB-Inc/TileDB-ML.git
cd TileDB-ML

# In case you want to install and check all frameworks. If you
# use zsh replace .[full] with .\[full\]
pip install -e .[full]

# In case you want to install and check Tensorflow only. If you
# use zsh replace .[tensorflow] with .\[tensorflow\]
pip install -e .[tensorflow]

# In case you want to install and check PyTorch only. If you
# use zsh replace .[pytorch] with .\[pytorch\]
pip install -e .[pytorch]

# In case you want to install and check Scikit-Learn only. If you
# use zsh replace .[sklearn] with .\[sklearn\]
pip install -e .[sklearn]  

# In case you want to try any of the aforementioned machine learning framework
# on TileDB-Cloud try one of the follwoing.
pip install -e .[tensorflow_cloud]
pip install -e .[pytorch_cloud]
pip install -e .[sklearn_cloud]with pip from git:pip install git+https://github.com/TileDB-Inc/TileDB-ML.git@masterfrom PyPi:pip install tiledb-mlThe above command will just install the basic dependency oftiledb-ml, hencetiledb.
In order to install the integration for a specific framework you need to use:pip install tiledb-ml[pytorch] # e.g. For checking only the Pytorch integrationChecking all the supported frameworks you will need to use:pip install tiledb-ml[full]The above commands apply tobashshell in case you usezshyou will
need to escape thebracketcharacter like the following for example:pip install tiledb-ml\[pytorch\]You may run the test suite with:python setup.py testNoteHere we would like to highlight that our current implementations are not optimal, and they don't support the aforementioned machine learning
frameworks 100%, e.g., serialization of model parts like numpy arrays, takes place with Pickle (which is far from optimal)
because of itsPython Onlynature and insecurity as describedhere.
We mainly show the universal data management ability of TileDB, and how elegantly applies in
machine learning data of any kind. Optimizations will follow as soon as possible.In any case, note that the TileDB-ML repository is under development, andthe API is subject to change.ContributingWe welcome all contributions! Please read thecontributing guidelinesbefore submitting pull requests.CopyrightThe TileDB-ML package is Copyright 2018-2021 TileDB, IncLicenseMIT