This is a simple tutorial for implementing machine learning with custom model in mobile apps. This tutorial consists of 3 parts
Simple TensorFlow Model for computing y= 2x+1. There are 3 repos
I could have used tensorflow lite for iOS. I implemented CoreML because, its easier with documentation and debugging. CoreML also supports on device machine learning. TFLite in iOS does not support on device machine learning.
I have used 'Nadam' optimizer with Mean absolute error regression loss. Feel free to play with different optimizer.
- Go to colab.google.com
- Open the jupyter notebook(ipynb) in this repo
- Click 'Connect' and wait till you get a free connection to google compute python backend
- Run the code
I have added comments in the jupyter notebook which are self explanatory.
When you successfully run all the code, you get the following items in files
- SampleModel.h5 - Tensor flow model which can be used later
- SampleTFLiteModel.tflite - TFLite Model for Android
- SampleMLModel.mlmodel - CoreML Model for iOS