Tuesday, May 01, 2018

TensorFlow.js: ML in web browsers


TensorFlow.js

TensorFlow.js
"A WebGL accelerated, browser based JavaScript library for training and deploying ML models."
  • Develop ML in the Browser
  • Run Existing models
  • Retrain Existing models


A very nice animation of neural network "learning" process.

A Neural Network Playground

References to free online bools about Machine Learning:

podcast interview with Director of Engineering in Google working on Tensorflow:


TensorFlow - YouTube - YouTube

example:
Teachable Machine

Porting of a complex application to web browser could be done by

  1. rewriting it in JavaScript, apparently what Google has done, or
  2. cross-compiling C++ binary to WebAssembly 
Here is an attempt of the second approach:

tomasreimers/tensorflow-emscripten: @ GitHub

MXnet, another major machine learning library, used and supported by Amazon
is available cross-compiled:

dmlc/mxnet.js: MXNetJS: Javascript Package for Deep Learning in Browser (without server) @ GitHub

A predictable future: Microsoft's CNTK, a ML library similar to Tensorflow and MXnet,
will be cross-compiled to WebAssembly soon :) If whole .NET can run in the browser, so can ML tools.

Microsoft/CNTK: Microsoft Cognitive Toolkit (CNTK), an open source deep-learning toolkit @ GitHub


Azure Container Instances (ACI)

Microsoft is offering "managed containers" that are simple to use, and could be also managed by Kubernetes and used in many other combinations. This is half-way between VMs and cloud functions, could be quite useful.
Azure Container Instances | Microsoft Azure
"Easily run containers on Azure without managing servers"

This may be the simplest to use  application of ACI:
Azure Linux Web Apps (PaaS) are deployed as managed containers,
and have all integration and auto-scaling and load balancing.
App Service - Web App for Containers | Microsoft Azure

Very informative podcast interview with Microsoft insider:
Container Instances with Gabe Monroy | Software Engineering Daily

Pricing Overview - How Azure pricing works | Microsoft Azure
App Service: from $0.013/h, VM: from $0.011/h.
So managing instances (VMs or containers in VM) including load balancing is $0.002/h
that is 18% difference, from $1.44/month.

Heroku, a part of SalesForce, was always selling only containers
but prices on Azure ware better last time I compared.
Cloud Application Platform | Heroku