"No one is harder on a talented person than the person themselves" - Linda Wilkinson ; "Trust your guts and don't follow the herd" ; "Validate direction not destination" ;

November 13, 2019

Day #296 - TensorflowLite

TensorflowLite models run in gmail, google photos, google assistant, google photos etc..

Advantages
  • Low Latency
  • No Data connection required
  • On device sensors
Key Points
  • On Device ML on many platforms
  • Tensorflow model saved in graph format
  • Converted to Lite format
TFLite
  • Model compression
  • Quantization
  • Optimized SIMD Kernels
  • Converter to generate model. Interpreter to run models
Benefits
  • Cross-Platform deployment
  • Inference speed increases
  • Binary size reduction
  • Hardware acceleration roadmap
#Build and save keras model
model = build_your_model()
tf.keras.experimental.export_saved_model(model,saved_model_dir)

#convert keras to tensorflow lite model
converter = tf.lite.TFLiteConverter.from_saved_models(saved_model_dir)
#To experiment new feature
converter.experimental_new_converter = True
tflite_model = converter.convert()

Link1, Link2

Improve Performance of models
  • Reduce precision of weights (16 bit instead of 32 bit precision) - Quantization
  • Pruning - Remove connections during training
  • Op Kernels - ARM
  • Delegates - GPU (Run on Specialized hardware)




Tensorflow Lite on Micro-controllers is an impressive move. More than mobiles, cross platforms this is a very impressive step.

Happy Learning!!!

No comments: