$30 off During Our Annual Pro Sale. View Details »

Demystifying Machine Learning on the Web with Tensorflow.js

Demystifying Machine Learning on the Web with Tensorflow.js

This talk would give a little background into what machine learning is, and an introduction to TensorFlowJS. We would talk briefly about the benefits of machine learning on the browser and show some practical applications. We’d also look into the different methods, and platforms in which it can be used and some demos on how it can be used.

This talk was delivered at the First Open Source Festival in Africa

shedrack akintayo

February 21, 2020
Tweet

More Decks by shedrack akintayo

Other Decks in Programming

Transcript

  1. Demystifying Machine
    Learning on the Web
    with Tensorflow.js. Shedrack Akintayo
    RelianceHMO
    @coder_blvck

    View Slide

  2. Meet Shedrack!
    - Frontend Engineer.‍
    - Loves music and movies.
    - Loves all things javascript.
    Shedrack Akintayo
    RelianceHMO
    @coder_blvck

    View Slide

  3. I’m NOT a Machine Learning
    Engineer, I just happen to
    know Javascript ‍♂

    View Slide

  4. What is Machine Learning
    though?

    View Slide

  5. Open Source
    Festival 2020
    Machine Learning
    Machine Learning is the ability of computers to learn by themselves from
    specific data called datasets without being explicitly programmed.

    View Slide

  6. Open Source
    Festival 2020
    Types of Machine Learning
    ● Supervised Learning
    ● Unsupervised Learning
    ● Reinforcement Learning

    View Slide

  7. What is Tensorflow &&
    Tensorflow.js

    View Slide

  8. Photo
    comes here
    Tensorflow
    Tensorflow is an end to end open source
    machine learning platform with a
    comprehensive and flexible ecosystem of
    tools, libraries, community support and
    resources.

    View Slide

  9. Open Source
    Festival 2020
    Tensorflow.js
    This is an open source javascript library built
    on deeplearn.js(Tensor Flow) used for
    creating deep learning modules on the
    browser. With it we can create CNNs, RNNs,
    etc. directly on the browser and train these
    modules using the Client’s GPU processing
    power. Hence, a server GPU is not necessary
    to train the modules.

    View Slide

  10. Open Source
    Festival 2020
    TensorFlow.js Stack.
    ● TensorFlow.js Core: A flexible low-level API, formerly known as
    deeplearn.js
    ● TensorFlow.js Layers: A high-level API which implements functionality
    similar to keras
    ● TensorFlow.js Data: A simple API to load and prepare data
    ● TensorFlow.js Converter: tools to import a TensorFlow SavedModel to
    TensorFlow.js

    View Slide

  11. Overview of Tensorflow.js
    APIs ⛩

    View Slide

  12. Tensorflow.js is powered by WebGL and it
    offers high-level layers API for defining
    models, and a low-level API for linear
    Algebra and automatic differentiation.
    TensorFlow.js also supports importing
    TensorFlow SavedModels and Keras
    Models

    View Slide

  13. View Slide

  14. Platforms that support
    Tensorflow.js

    View Slide

  15. Open Source
    Festival 2020
    Browser React Native
    (coming soon)
    NodeJS

    View Slide

  16. Why Tensorflow.js
    though? ‍♂

    View Slide

  17. Why Tensorflow.js
    ● You can import an existing, pre-trained model for inference.
    ● You can retrain an imported model
    ● You can author models directly in the browser
    ● Write once, run everywhere.
    ● No drivers or installs
    ● Easy to Visualize and interact with data

    View Slide

  18. Important Terms used in
    TensorFlow.js

    View Slide

  19. Terms
    ● Tensor: This is the central unit of values in Tensorflow, it consists
    of a set of values shaped into an array of one or more dimensions
    ● Models: A set of functions that looks for a relationship between
    features and labels of data
    ● Epoch: An epoch is the entire processing or iteration by the
    learning algorithm of the entire data-set.
    ● Learning rate: is a configurable hyperparameter used in the
    training of neural networks that has a small positive value, often in
    the range between 0.0 and 1.0.

    View Slide

  20. Pretrained Models in
    TensorFlow.js

    View Slide

  21. Pretrained Models
    These are machine learning models that have already been written in
    tensorflow. It is also a saved network that was previously trained on a
    large dataset, typically on a large-scale image-classification task.
    They are trained to either deal with data in form of audio, image or text.
    The have very easy to use APIs, you just have to install or link them from
    their respective CDNS to use them

    View Slide

  22. Some Pretrained Models available in
    Tensorflow.js
    ● Object Classification
    ● Body Segmentation
    ● Image classification
    ● Speech Command Recognition
    ● Sentence Encoding.

    View Slide

  23. Limitations of Tensorflow.js
    ● Needs a large amount of data(unless using pre-trained models)
    ● Training on the web is slow. It takes a lot of time
    ● Bias and Ethics
    ● Speech Command Recognition
    ● Sentence Encoding.

    View Slide

  24. Useful links &&
    Resources

    View Slide

  25. Demo Links for Tensorflow.js
    ● Game Demo by Ashinze Ekene
    ● TensorFlow.js website
    ● Pretrained Models
    ● Deep Learning with javascript book
    ● Tensorflow.js Demos

    View Slide

  26. Learning Resources and References
    ● Machine Learning Course from stanford
    ● Machine Learning Crash Course by Google
    ● Machine Learning for frontend developers by Charlie Gerard
    ● Machine Learning Magic for your Javascript Application
    ● Machine Learning for frontend developer by Charlie Gerard| JS Heroes
    2019
    ● Machine Learning on the browser with Tensorflow.js by Ashinze
    Ekene[slides]
    ● A Gentle Introduction to Tensorflow.js

    View Slide

  27. Thank
    you! Shedrack Akintayo
    RelianceHMO
    @coder_blvck

    View Slide

  28. View Slide