Successfully reported this slideshow.
We use your LinkedIn profile and activity data to personalize ads and to show you more relevant ads. You can change your ad preferences anytime.

TensorFlow London 17: Ultra portable Deep Learning with Tensorflow.js

267 views

Published on

Title: Ultra portable Deep Learning with Tensorflow.js

Speaker: Zack Akil, Developer Advocate at Google

Abstract: Traditional machine learning systems usually require some installation process when you want to run them on your own device, not anymore! Zack will be giving give an overview of TensorFlow.js, which allows you to be training and running ML models on your device by simply visiting a webpage.

Bio: Zack is Developer advocate at Google and Central London Data Science Project Nights meetup organizer.

Published in: Technology
  • Be the first to comment

  • Be the first to like this

TensorFlow London 17: Ultra portable Deep Learning with Tensorflow.js

  1. 1. TensorFlow.js @ZackAkil Build & run machine learning models on webpages js.tensorflow.org
  2. 2. Standard TensorFlow ● App installation required for model to run on your device Build Train Test RunDeploy Developer machine or Cloud Client App or Cloud ● Do all training up-front ● Constant web connection required for Cloud hosted models
  3. 3. TensorFlow.js Build Train Test Run Client Browser ● App installation required for model to run on your device ● Just visit a webpage! ● Do all training up-front ● You can train a model more in the browser! ● Constant web connection required for Cloud hosted models ● Once the page is loaded you’re all set!
  4. 4. To the Demos! https://js.tensorflow.org/
  5. 5. github.com/ZackAkil/online-learning-with-tensorflow-js
  6. 6. Code for new model model.add(tf.layers.dense({ units: 3, inputShape: [4] })) model.add(tf.layers.dense({ units: 2 })) model.compile({ loss: 'meanSquaredError', optimizer: 'sgd' }) const xtrain = tf.tensor2d(x) const ytrain = tf.tensor2d(y) const model = tf.sequential(); model.fit(xtrain, ytrain, { epochs: 200 }).then(() => { console.log("finished training") }); model.predict(newX).dataSync() //.dataSync() gets values synchronously
  7. 7. github.com/ZackAkil/mnist-draw
  8. 8. Code for loaded model const model = await tf.loadModel('model.json') model.predict(newX).dataSync() //.dataSync() gets values synchronously newX = tf.fromPixels(canvas, 1) // 1 is for gray scale, 3 for RGB
  9. 9. Thank you @ZackAkil js.tensorflow.org

×