Machine learning and AI with ONNX in SQL Edge (Preview)
Machine learning in Azure SQL Edge (Preview) supports models in the Open Neural Network Exchange (ONNX) format. ONNX is an open format you can use to interchange models between various machine learning frameworks and tools.
To infer machine learning models in Azure SQL Edge, you will first need to get a model. This can be a pre-trained model or a custom model trained with your framework of choice. Azure SQL Edge supports the ONNX format and you will need to convert the model to this format. There should be no impact on model accuracy, and once you have the ONNX model, you can deploy the model in Azure SQL Edge and use native scoring with the PREDICT T-SQL function.
Get ONNX models
To obtain a model in the ONNX format:
Model Building Services: Services such as the automated Machine Learning feature in Azure Machine Learning and Azure Custom Vision Service support directly exporting the trained model in the ONNX format.
Convert and/or export existing models: Several training frameworks (e.g. PyTorch, Chainer, and Caffe2) support native export functionality to ONNX, which allows you to save your trained model to a specific version of the ONNX format. For frameworks that do not support native export, there are standalone ONNX Converter installable packages that enable you to convert models trained from different machine learning frameworks to the ONNX format.
Currently, not all ONNX models are supported by Azure SQL Edge. The support is limited to models with numeric data types:
Other numeric types can be converted to supported types by using CAST and CONVERT.
The model inputs should be structured so that each input to the model corresponds to a single column in a table. For example, if you are using a pandas dataframe to train a model, then each input should be a separate column to the model.