Upgrade to Pro — share decks privately, control downloads, hide ads and more …

TensorFlow.js - Past, Present and Future

Vikram
August 07, 2019

TensorFlow.js - Past, Present and Future

What is TensorFlow.js, how to use it for various common tasks and what next to expect from the team.

Vikram

August 07, 2019
Tweet

More Decks by Vikram

Other Decks in Programming

Transcript

  1. Come join us in building Personalized automation for the Web

    - Senior Full-stack Dev Node.js, Google Cloud - Senior Frontend Dev JavaScript, React, Redux - Senior UI/UX Designer Graphic Design, UI/UX https://omniinc.com/careers @Vikram_Tiwari
  2. @Vikram_Tiwari TensorFlow.js A machine learning library for JavaScript Run existing

    models Pre-packaged JavaScript or Converted from Python
  3. TensorFlow.js A machine learning library for JavaScript Retrain existing models

    With transfer learning Run existing models Pre-packaged JavaScript or Converted from Python @Vikram_Tiwari
  4. TensorFlow.js A machine learning library for JavaScript Write models in

    JS Train from scratch Retrain existing models With transfer learning Run existing models Pre-packaged JavaScript or Converted from Python @Vikram_Tiwari
  5. 5M CDN hits 120+ contributors 500K NPM downloads 11K GitHub

    stars TensorFlow.js turns 1.0 ! @Vikram_Tiwari
  6. Ready to use Models JavaScript APIs for common ML tasks

    Image Classification Object Detection Pose Detection Speech Commands Text Classification npm install or use from hosted scripts @Vikram_Tiwari
  7. - Use pre-trained off-the shelf models - Convert existing Python

    models - Train in the browser and Node.js - Deploy on Platforms @Vikram_Tiwari With tf.js you can Platforms Core API Layers API Models
  8. <script src=".../@tensorflow/tfjs"></script> <script src=".../@tensorflow-models/toxicity"></script> const model = await toxicity.load(); const

    results = model.classify(['you suck']); // Result { "label": "identity_attack", "results": [{ "probabilities": [0.96, 0.03], "match": false }] }, { "label": "insult", "results": [{ "probabilities": [0.08, 0.91], "match": true }] }, ... Text Toxicity Text Classifier http://bit.ly/2OBQ4PT @Vikram_Tiwari
  9. Bring py modules to js - Command line tool -

    Saved Model, TFHub, Keras - 170+ ops - TensorFlow 2.0 support @Vikram_Tiwari
  10. const model = tf.sequential(); model.add(tf.layers.conv2d({ inputShape: [IMAGE_WIDTH, IMAGE_HEIGHT, IMAGE_CHANNELS], kernelSize:

    5, filters: 8, strides: 1, activation: 'relu', kernelInitializer: 'varianceScaling' })); model.add(tf.layers.maxPooling2d({poolSize: [2, 2], strides: [2, 2]})); ... model.add(tf.layers.flatten()); model.add(tf.layers.dense({ units: NUM_CLASSES, activation: 'softmax' })); @Vikram_Tiwari
  11. model.compile({ loss: 'categoricalCrossentropy', optimizer: 'sgd' }); // Train model from

    scratch or transfer learning. await model.fit(xs, ys, {epochs: 10}); // Save the result of training. await model.save('localstorage://my-js-model'); // After training, get prediction from model. const prediction = model.predict(input); @Vikram_Tiwari
  12. Creatability Exploring how creative tools can be made more accessible

    for everyone. experiments.withgoogle.com/collection/creatability @Vikram_Tiwari
  13. What’s did it take? Everything - Fixing bugs in browsers

    - Matrix operations on WebGL - Tensorflow Ops and Layers APIs on tfjs/core - Data API and more... @Vikram_Tiwari
  14. What’s Next? - More ready-to-use models - Easier access for

    data and other browser APIs - More supported operations for building models - WebGL to WASM... maybe!? @Vikram_Tiwari
  15. @Vikram_Tiwari Co-founder, Tech at Omni Labs, Inc. GDE for Cloud

    and Machine Learning That’s all folks!