SlideShare a Scribd company logo
A LOOK AT
TENSORFLOW.JS
Jamal O’Garro
Software Engineer
MEAN STACK NYC | MAY 17, 2018
• Full-stack web-developer based in
NYC
• Professional Languages: JavaScript,
Node, React, D3, TypeScript, Python
• Hobby languages: Haskell, Golang
• Mostly self-taught
• Native New Yorker
• Sneakerhead + Hip Hop Head
• True Knicks fan
MEAN STACK NYC | MAY 17, 2018
BIO
• High level overview of deep learning and neural
networks
• Look at the TensorFlow.js API
• Look at some examples provided by Google
TODAY’S AGENDA
MEAN STACK NYC | MAY 17, 2018
• Comfortable with JavaScript
• Familiar with ES6/ES7/ES8 syntax
• Not going to assume you will get all of the theory (very
little math!)
ASSUMPTIONS
MEAN STACK NYC | MAY 17, 2018
MACHINE & DEEP LEARNING
MEAN STACK NYC | MAY 17, 2018
“Artificial intelligence (AI, also machine
intelligence, MI) intelligence demonstrated
by machines, in contrast to the natural
intelligence (NI) displayed by humans and other
animals. ”
- Wikipedia
WHAT IS ARTIFICIAL INTELLIGENCE?
MEAN STACK NYC | MAY 17, 2018
“Machine learning is a field of computer science that
uses statistical techniques to give computer
systems the ability to "learn" (e.g., progressively
improve performance on a specific task) with data,
without being explicitly programmed.”
- Wikipedia
WHAT IS MACHINE LEARNING?
MEAN STACK NYC | MAY 17, 2018
“Deep Learning is a subfield of machine learning
concerned with algorithms inspired by the structure
and function of the brain called artificial neural
networks.”
- Jason Brownlee, Machine Learning Mastery
WHAT IS DEEP LEARNING?
MEAN STACK NYC | MAY 17, 2018
• Facebook Face Recognition
• Amazon product recommendations
• Netflix movie recommendations
• Spotify music recommendations
• Uber estimated time of arrival
• Predicting stock price movements
EXAMPLES OF ML IN THE WILD
MEAN STACK NYC | MAY 17, 2018
• Supervised Learning - learn how to classify or predict
a value based on previous observations
• Unsupervised Learning - find a pattern from existing
data
• Reinforcement Learning - provide positive or
negative feedback based on expected outcome
TYPES OF LEARNING
MEAN STACK NYC | MAY 17, 2018
NEURAL NETWORKS
MEAN STACK NYC | MAY 17, 2018
“Artificial neural networks (ANNs)
or connectionist systems are computing systems
vaguely inspired by the biological neural
networks that constitute animal brains. Such
systems "learn" (i.e. progressively improve
performance on) tasks by considering examples,
generally without task-specific programming.” 
- Wikipedia
WHAT IS A NEURAL NETWORK?
MEAN STACK NYC | MAY 17, 2018
• Dendrite - receives signals from another neuron
• Neuron - processes the signal
• Axon - transmits signals to another neuron
BIOLOGICAL NEURAL NETWORK
MEAN STACK NYC | MAY 17, 2018
HUMAN NEURON DIAGRAM
MEAN STACK NYC | MAY 17, 2018
- Wikipedia
• Input layers - layer that contains our data that we want
to learn from
• Hidden layers - layers that sit between the input and
output layers (process data and return and output)
• Output layer - final output or estimate
NEURAL NETWORK COMPONENTS
MEAN STACK NYC | MAY 17, 2018
NEURAL NETWORK DIAGRAM
MEAN STACK NYC | MAY 17, 2018
- Wikipedia
• Allow us to normalize our data
• Sigmoid - normalizes value between 0 and 1
• ReLU - returns max of 0 and a value
• tanh - normalizes value to between -1 and 1
ACTIVATION FUNCTIONS
MEAN STACK NYC | MAY 17, 2018
ACTIVATION FUNCTIONS - SIGMOID
MEAN STACK NYC | MAY 17, 2018
- www.towardsdatascience.com
ACTIVATION FUNCTIONS - ReLU
MEAN STACK NYC | MAY 17, 2018
- www.towardsdatascience.com
ACTIVATION FUNCTIONS - tanh
MEAN STACK NYC | MAY 17, 2018
- www.towardsdatascience.com
• Allow us to evaluate the performance of our model (how
far off are our predictions from the actual observations)
• Mean Squared Error - good choice for regression
problems
• Cross Entropy - good choice for classification
problems
COST FUNCTIONS
MEAN STACK NYC | MAY 17, 2018
COST FUNCTIONS - MEAN SQUARED ERROR
MEAN STACK NYC | MAY 17, 2018
- Wikipedia
COST FUNCTIONS - CROSS ENTROPY
MEAN STACK NYC | MAY 17, 2018
- Wikipedia
TRAINING
MEAN STACK NYC | MAY 17, 2018
• The process of minimizing the errors between our
predictions and our observations
• Minimizing our cost function
GRADIENT DESCENT
MEAN STACK NYC | MAY 17, 2018
• Algorithm that allows us to find the minimum of a
function
• Take a guess along a curve or surface and take steps in
the negative direction until we find a global minimum (i.e.
dy/dx = 0)
• Learning Rate - size of the steps we take when
searching for our global minimum
GRADIENT DESCENT DIAGRAM
MEAN STACK NYC | MAY 17, 2018
- Wikipedia
BACK PROPAGATION
MEAN STACK NYC | MAY 17, 2018
• Calculates how much each predicted value contributes
to an error
• When we have an error we adjust the weights, biases,
etc. of our neurons to reduce it (i.e. minimize the cost)
TENSORFLOW
MEAN STACK NYC | MAY 17, 2018
WHAT IS TENSORFLOW?
• Numerical computation library developed and open
sourced by Google
• Runs on CPU/GPU across clusters and sessions
• Data flows through Tensors
• Can create models and deploy to different production
systems (Web, Mobile apps, etc.)
• Written in C++
MEAN STACK NYC | MAY 17, 2018
TENSORFLOW ECOSYSTEM
MEAN STACK NYC | MAY 17, 2018
TENSORFLOW.JS ECOSYSTEM
MEAN STACK NYC | MAY 17, 2018
TENSORFLOW.JS
• Originally was deeplearning.js
• Two APIs (Core + Layers)
• Can build new models and retrain existing ones
• Ability to load existing models for inference
• Uses the computer’s GPU for both training and inference
• Browser ready with active development on Node bindings
MEAN STACK NYC | MAY 17, 2018
• Tensor
• Variable
• Session
• Layer
• Model
TENSORFLOW.JS TERMINOLOGY
MEAN STACK NYC | MAY 17, 2018
CORE API
• Low-level operations
• Linear Algebra transformations
• Written in pure JavaScript
• Targets the GPU via WebGL
MEAN STACK NYC | MAY 17, 2018
CORE API - TENSORS
• Immutable data in our program
• Scalar
• Vector
• Matrix
MEAN STACK NYC | MAY 17, 2018
CORE API - VARIABLES
• Mutable data that can be reassigned during the life of our
program
MEAN STACK NYC | MAY 17, 2018
CORE API - OPERATIONS
• Allows us to manipulate our data
• tf.add - adds two tensors
• tf.sub - subtracts two tensors
• tf.mul - multiplies two tensors
• tf.div - divides two tensors
• tf.maximum - returns the max of two tensors
• tf.minimum - returns the min of two tensors
MEAN STACK NYC | MAY 17, 2018
CORE API
MEAN STACK NYC | MAY 17, 2018
LAYERS API
• Inspired by Keras
• Built on top of the Core API
• High-level abstractions of neural network constructs
MEAN STACK NYC | MAY 17, 2018
LAYERS API - MODEL
• A function when given some input will produce and output
• tf.Model - basic unit of training
• tf.Sequential - a model with a stack of layers feeding
from one layer to the next
MEAN STACK NYC | MAY 17, 2018
LAYERS API - LAYER
• Primary building block for building a model. Performs
transformation to convert an input into an output.
• tf.layers.activation - applies an activation function to a layer
• tf.layers.dense - creates a fully connected layer
• tf.layers.flatten - flattens input to one dimension
• tf.layers.reshape - reshapes an input to a specified shape
MEAN STACK NYC | MAY 17, 2018
LAYERS API - CONFIG
• Loss - the model’s loss function
• Optimizer - algorithm that minimizes the error of our
model
• Metrics - list of metrics to be evaluated
MEAN STACK NYC | MAY 17, 2018
LAYERS API
MEAN STACK NYC | MAY 17, 2018
MEMORY MANAGEMENT
• Must manage memory on the GPU when working with Tensors and variables
• Easy to create memory leaks if you’re not careful
• Tensor.dispose - disposes of a tensor
• tf.tidy - provides a scope for us to run our program in and cleans up any
tensors created during the process
• Should be a synchronous function
• Does not clean up variables (must dispose manually)
• tf.keep - prevents a tensor created within a “tidy” block from being
disposed
MEAN STACK NYC | MAY 17, 2018
• Can train new and retrain existing models in the browser
• Can use existing models for inference in the browser
• Soon we’ll be able to do this in Node!
WHY IS THIS AWESOME?
MEAN STACK NYC | MAY 17, 2018
LET’S BUILD A BRAIN!
MEAN STACK NYC | MAY 17, 2018
RESOURCES
MEAN STACK NYC | MAY 17, 2018
RESOURCES
Documentation
• js.tensorflow.org
• TensorFlow.js Github Repository
• Google Developers Deep Learning Glossary
Books
• Deep Learning with Python - Francois Chollet
• Learning from Data - Yaser S. Abu-Mostafa
• Neural Networks and Deep Learning - Michael Nielsen
Courses
• Google's Deep Learning Crash Course
• deeplearning.ai
Tools
• TensorFlow Playground
Datasets
• Kaggle
MEAN STACK NYC | MAY 17, 2018
THANK YOU!!!
Jamal O’Garro
Software Engineer + Instructor
MEAN STACK NYC | MAY 17, 2018
Ad

More Related Content

What's hot (20)

Extracting Insights from Data at Twitter
Extracting Insights from Data at TwitterExtracting Insights from Data at Twitter
Extracting Insights from Data at Twitter
Prasad Wagle
 
Apache Flink and what it is used for
Apache Flink and what it is used forApache Flink and what it is used for
Apache Flink and what it is used for
Aljoscha Krettek
 
Lambda architecture @ Indix
Lambda architecture @ IndixLambda architecture @ Indix
Lambda architecture @ Indix
Rajesh Muppalla
 
The Lyft data platform: Now and in the future
The Lyft data platform: Now and in the futureThe Lyft data platform: Now and in the future
The Lyft data platform: Now and in the future
markgrover
 
Zipline: Airbnb’s Machine Learning Data Management Platform with Nikhil Simha...
Zipline: Airbnb’s Machine Learning Data Management Platform with Nikhil Simha...Zipline: Airbnb’s Machine Learning Data Management Platform with Nikhil Simha...
Zipline: Airbnb’s Machine Learning Data Management Platform with Nikhil Simha...
Databricks
 
Apache Flink 101 - the rise of stream processing and beyond
Apache Flink 101 - the rise of stream processing and beyondApache Flink 101 - the rise of stream processing and beyond
Apache Flink 101 - the rise of stream processing and beyond
Bowen Li
 
How Spark Enables the Internet of Things- Paula Ta-Shma
How Spark Enables the Internet of Things- Paula Ta-ShmaHow Spark Enables the Internet of Things- Paula Ta-Shma
How Spark Enables the Internet of Things- Paula Ta-Shma
Spark Summit
 
How KeyBank Used Elastic to Build an Enterprise Monitoring Solution
How KeyBank Used Elastic to Build an Enterprise Monitoring SolutionHow KeyBank Used Elastic to Build an Enterprise Monitoring Solution
How KeyBank Used Elastic to Build an Enterprise Monitoring Solution
Elasticsearch
 
An Update on Scaling Data Science Applications with SparkR in 2018 with Heiko...
An Update on Scaling Data Science Applications with SparkR in 2018 with Heiko...An Update on Scaling Data Science Applications with SparkR in 2018 with Heiko...
An Update on Scaling Data Science Applications with SparkR in 2018 with Heiko...
Databricks
 
Introduction to Stream Processing with Apache Flink (2019-11-02 Bengaluru Mee...
Introduction to Stream Processing with Apache Flink (2019-11-02 Bengaluru Mee...Introduction to Stream Processing with Apache Flink (2019-11-02 Bengaluru Mee...
Introduction to Stream Processing with Apache Flink (2019-11-02 Bengaluru Mee...
Timo Walther
 
Using Apache Spark to Predict Installer Retention from Messy Clickstream Data...
Using Apache Spark to Predict Installer Retention from Messy Clickstream Data...Using Apache Spark to Predict Installer Retention from Messy Clickstream Data...
Using Apache Spark to Predict Installer Retention from Messy Clickstream Data...
Databricks
 
Leveraging Spark to Democratize Data for Omni-Commerce with Shafaq Abdullah
Leveraging Spark to Democratize Data for Omni-Commerce with Shafaq AbdullahLeveraging Spark to Democratize Data for Omni-Commerce with Shafaq Abdullah
Leveraging Spark to Democratize Data for Omni-Commerce with Shafaq Abdullah
Databricks
 
Lambda Architecture 2.0 for Reactive AB Testing
Lambda Architecture 2.0 for Reactive AB TestingLambda Architecture 2.0 for Reactive AB Testing
Lambda Architecture 2.0 for Reactive AB Testing
Trieu Nguyen
 
Introduction to Streaming with Apache Flink
Introduction to Streaming with Apache FlinkIntroduction to Streaming with Apache Flink
Introduction to Streaming with Apache Flink
Tugdual Grall
 
MLSD18. Automating Machine Learning Workflows
MLSD18. Automating Machine Learning WorkflowsMLSD18. Automating Machine Learning Workflows
MLSD18. Automating Machine Learning Workflows
BigML, Inc
 
Bay Area Apache Flink Meetup Community Update August 2015
Bay Area Apache Flink Meetup Community Update August 2015Bay Area Apache Flink Meetup Community Update August 2015
Bay Area Apache Flink Meetup Community Update August 2015
Henry Saputra
 
Realtime streaming architecture in INFINARIO
Realtime streaming architecture in INFINARIORealtime streaming architecture in INFINARIO
Realtime streaming architecture in INFINARIO
Jozo Kovac
 
Pm.ais ummit 180917 final
Pm.ais ummit 180917 finalPm.ais ummit 180917 final
Pm.ais ummit 180917 final
Nisha Talagala
 
RFX - Full-Stack Technology for Real-time Big Data
RFX - Full-Stack Technology for Real-time Big DataRFX - Full-Stack Technology for Real-time Big Data
RFX - Full-Stack Technology for Real-time Big Data
Trieu Nguyen
 
Big Data Analytics with Qlik & Splunk, Qlik Qonnections
Big Data Analytics with Qlik & Splunk, Qlik QonnectionsBig Data Analytics with Qlik & Splunk, Qlik Qonnections
Big Data Analytics with Qlik & Splunk, Qlik Qonnections
Geralyn Maloney
 
Extracting Insights from Data at Twitter
Extracting Insights from Data at TwitterExtracting Insights from Data at Twitter
Extracting Insights from Data at Twitter
Prasad Wagle
 
Apache Flink and what it is used for
Apache Flink and what it is used forApache Flink and what it is used for
Apache Flink and what it is used for
Aljoscha Krettek
 
Lambda architecture @ Indix
Lambda architecture @ IndixLambda architecture @ Indix
Lambda architecture @ Indix
Rajesh Muppalla
 
The Lyft data platform: Now and in the future
The Lyft data platform: Now and in the futureThe Lyft data platform: Now and in the future
The Lyft data platform: Now and in the future
markgrover
 
Zipline: Airbnb’s Machine Learning Data Management Platform with Nikhil Simha...
Zipline: Airbnb’s Machine Learning Data Management Platform with Nikhil Simha...Zipline: Airbnb’s Machine Learning Data Management Platform with Nikhil Simha...
Zipline: Airbnb’s Machine Learning Data Management Platform with Nikhil Simha...
Databricks
 
Apache Flink 101 - the rise of stream processing and beyond
Apache Flink 101 - the rise of stream processing and beyondApache Flink 101 - the rise of stream processing and beyond
Apache Flink 101 - the rise of stream processing and beyond
Bowen Li
 
How Spark Enables the Internet of Things- Paula Ta-Shma
How Spark Enables the Internet of Things- Paula Ta-ShmaHow Spark Enables the Internet of Things- Paula Ta-Shma
How Spark Enables the Internet of Things- Paula Ta-Shma
Spark Summit
 
How KeyBank Used Elastic to Build an Enterprise Monitoring Solution
How KeyBank Used Elastic to Build an Enterprise Monitoring SolutionHow KeyBank Used Elastic to Build an Enterprise Monitoring Solution
How KeyBank Used Elastic to Build an Enterprise Monitoring Solution
Elasticsearch
 
An Update on Scaling Data Science Applications with SparkR in 2018 with Heiko...
An Update on Scaling Data Science Applications with SparkR in 2018 with Heiko...An Update on Scaling Data Science Applications with SparkR in 2018 with Heiko...
An Update on Scaling Data Science Applications with SparkR in 2018 with Heiko...
Databricks
 
Introduction to Stream Processing with Apache Flink (2019-11-02 Bengaluru Mee...
Introduction to Stream Processing with Apache Flink (2019-11-02 Bengaluru Mee...Introduction to Stream Processing with Apache Flink (2019-11-02 Bengaluru Mee...
Introduction to Stream Processing with Apache Flink (2019-11-02 Bengaluru Mee...
Timo Walther
 
Using Apache Spark to Predict Installer Retention from Messy Clickstream Data...
Using Apache Spark to Predict Installer Retention from Messy Clickstream Data...Using Apache Spark to Predict Installer Retention from Messy Clickstream Data...
Using Apache Spark to Predict Installer Retention from Messy Clickstream Data...
Databricks
 
Leveraging Spark to Democratize Data for Omni-Commerce with Shafaq Abdullah
Leveraging Spark to Democratize Data for Omni-Commerce with Shafaq AbdullahLeveraging Spark to Democratize Data for Omni-Commerce with Shafaq Abdullah
Leveraging Spark to Democratize Data for Omni-Commerce with Shafaq Abdullah
Databricks
 
Lambda Architecture 2.0 for Reactive AB Testing
Lambda Architecture 2.0 for Reactive AB TestingLambda Architecture 2.0 for Reactive AB Testing
Lambda Architecture 2.0 for Reactive AB Testing
Trieu Nguyen
 
Introduction to Streaming with Apache Flink
Introduction to Streaming with Apache FlinkIntroduction to Streaming with Apache Flink
Introduction to Streaming with Apache Flink
Tugdual Grall
 
MLSD18. Automating Machine Learning Workflows
MLSD18. Automating Machine Learning WorkflowsMLSD18. Automating Machine Learning Workflows
MLSD18. Automating Machine Learning Workflows
BigML, Inc
 
Bay Area Apache Flink Meetup Community Update August 2015
Bay Area Apache Flink Meetup Community Update August 2015Bay Area Apache Flink Meetup Community Update August 2015
Bay Area Apache Flink Meetup Community Update August 2015
Henry Saputra
 
Realtime streaming architecture in INFINARIO
Realtime streaming architecture in INFINARIORealtime streaming architecture in INFINARIO
Realtime streaming architecture in INFINARIO
Jozo Kovac
 
Pm.ais ummit 180917 final
Pm.ais ummit 180917 finalPm.ais ummit 180917 final
Pm.ais ummit 180917 final
Nisha Talagala
 
RFX - Full-Stack Technology for Real-time Big Data
RFX - Full-Stack Technology for Real-time Big DataRFX - Full-Stack Technology for Real-time Big Data
RFX - Full-Stack Technology for Real-time Big Data
Trieu Nguyen
 
Big Data Analytics with Qlik & Splunk, Qlik Qonnections
Big Data Analytics with Qlik & Splunk, Qlik QonnectionsBig Data Analytics with Qlik & Splunk, Qlik Qonnections
Big Data Analytics with Qlik & Splunk, Qlik Qonnections
Geralyn Maloney
 

Similar to A Look at TensorFlow.js (20)

Machine Learning with JavaScript
Machine Learning with JavaScriptMachine Learning with JavaScript
Machine Learning with JavaScript
Ivo Andreev
 
Satwik mishra resume
Satwik mishra resumeSatwik mishra resume
Satwik mishra resume
Satwik Mishra
 
Satwik mishra resume
Satwik mishra resumeSatwik mishra resume
Satwik mishra resume
Satwik Mishra
 
Satwik resume
Satwik resumeSatwik resume
Satwik resume
Satwik Mishra
 
04 open source_tools
04 open source_tools04 open source_tools
04 open source_tools
Marco Quartulli
 
Applying Machine learning to IOT: End to End Distributed Distributed Pipeline...
Applying Machine learning to IOT: End to End Distributed Distributed Pipeline...Applying Machine learning to IOT: End to End Distributed Distributed Pipeline...
Applying Machine learning to IOT: End to End Distributed Distributed Pipeline...
Carol McDonald
 
Supervised Papers Classification on Large-Scale High-Dimensional Data with Ap...
Supervised Papers Classification on Large-Scale High-Dimensional Data with Ap...Supervised Papers Classification on Large-Scale High-Dimensional Data with Ap...
Supervised Papers Classification on Large-Scale High-Dimensional Data with Ap...
Leonidas Akritidis
 
Scaling Analytics with Apache Spark
Scaling Analytics with Apache SparkScaling Analytics with Apache Spark
Scaling Analytics with Apache Spark
QuantUniversity
 
Scalable Similarity-Based Neighborhood Methods with MapReduce
Scalable Similarity-Based Neighborhood Methods with MapReduceScalable Similarity-Based Neighborhood Methods with MapReduce
Scalable Similarity-Based Neighborhood Methods with MapReduce
sscdotopen
 
Applying Machine Learning to IOT: End to End Distributed Pipeline for Real-Ti...
Applying Machine Learning to IOT: End to End Distributed Pipeline for Real-Ti...Applying Machine Learning to IOT: End to End Distributed Pipeline for Real-Ti...
Applying Machine Learning to IOT: End to End Distributed Pipeline for Real-Ti...
Carol McDonald
 
Azure machine learning
Azure machine learningAzure machine learning
Azure machine learning
Mark Reynolds
 
Streaming Machine learning Distributed Pipeline for Real-Time Uber Data Using...
Streaming Machine learning Distributed Pipeline for Real-Time Uber Data Using...Streaming Machine learning Distributed Pipeline for Real-Time Uber Data Using...
Streaming Machine learning Distributed Pipeline for Real-Time Uber Data Using...
Carol McDonald
 
Voxxed days thessaloniki 21/10/2016 - Streaming Engines for Big Data
Voxxed days thessaloniki 21/10/2016 - Streaming Engines for Big DataVoxxed days thessaloniki 21/10/2016 - Streaming Engines for Big Data
Voxxed days thessaloniki 21/10/2016 - Streaming Engines for Big Data
Stavros Kontopoulos
 
Voxxed Days Thesaloniki 2016 - Streaming Engines for Big Data
Voxxed Days Thesaloniki 2016 - Streaming Engines for Big DataVoxxed Days Thesaloniki 2016 - Streaming Engines for Big Data
Voxxed Days Thesaloniki 2016 - Streaming Engines for Big Data
Voxxed Days Thessaloniki
 
Hands-on - Machine Learning using scikitLearn
Hands-on - Machine Learning using scikitLearnHands-on - Machine Learning using scikitLearn
Hands-on - Machine Learning using scikitLearn
avrtraining021
 
Azure 機器學習 - 使用Python, R, Spark, CNTK 深度學習
Azure 機器學習 - 使用Python, R, Spark, CNTK 深度學習 Azure 機器學習 - 使用Python, R, Spark, CNTK 深度學習
Azure 機器學習 - 使用Python, R, Spark, CNTK 深度學習
Herman Wu
 
Using Graph Analysis and Fraud Detection in the Fintech Industry
Using Graph Analysis and Fraud Detection in the Fintech IndustryUsing Graph Analysis and Fraud Detection in the Fintech Industry
Using Graph Analysis and Fraud Detection in the Fintech Industry
Stanka Dalekova
 
Using Graph Analysis and Fraud Detection in the Fintech Industry
Using Graph Analysis and Fraud Detection in the Fintech IndustryUsing Graph Analysis and Fraud Detection in the Fintech Industry
Using Graph Analysis and Fraud Detection in the Fintech Industry
Stanka Dalekova
 
R at Microsoft
R at MicrosoftR at Microsoft
R at Microsoft
Revolution Analytics
 
Shikha fdp 62_14july2017
Shikha fdp 62_14july2017Shikha fdp 62_14july2017
Shikha fdp 62_14july2017
Dr. Shikha Mehta
 
Machine Learning with JavaScript
Machine Learning with JavaScriptMachine Learning with JavaScript
Machine Learning with JavaScript
Ivo Andreev
 
Satwik mishra resume
Satwik mishra resumeSatwik mishra resume
Satwik mishra resume
Satwik Mishra
 
Satwik mishra resume
Satwik mishra resumeSatwik mishra resume
Satwik mishra resume
Satwik Mishra
 
Applying Machine learning to IOT: End to End Distributed Distributed Pipeline...
Applying Machine learning to IOT: End to End Distributed Distributed Pipeline...Applying Machine learning to IOT: End to End Distributed Distributed Pipeline...
Applying Machine learning to IOT: End to End Distributed Distributed Pipeline...
Carol McDonald
 
Supervised Papers Classification on Large-Scale High-Dimensional Data with Ap...
Supervised Papers Classification on Large-Scale High-Dimensional Data with Ap...Supervised Papers Classification on Large-Scale High-Dimensional Data with Ap...
Supervised Papers Classification on Large-Scale High-Dimensional Data with Ap...
Leonidas Akritidis
 
Scaling Analytics with Apache Spark
Scaling Analytics with Apache SparkScaling Analytics with Apache Spark
Scaling Analytics with Apache Spark
QuantUniversity
 
Scalable Similarity-Based Neighborhood Methods with MapReduce
Scalable Similarity-Based Neighborhood Methods with MapReduceScalable Similarity-Based Neighborhood Methods with MapReduce
Scalable Similarity-Based Neighborhood Methods with MapReduce
sscdotopen
 
Applying Machine Learning to IOT: End to End Distributed Pipeline for Real-Ti...
Applying Machine Learning to IOT: End to End Distributed Pipeline for Real-Ti...Applying Machine Learning to IOT: End to End Distributed Pipeline for Real-Ti...
Applying Machine Learning to IOT: End to End Distributed Pipeline for Real-Ti...
Carol McDonald
 
Azure machine learning
Azure machine learningAzure machine learning
Azure machine learning
Mark Reynolds
 
Streaming Machine learning Distributed Pipeline for Real-Time Uber Data Using...
Streaming Machine learning Distributed Pipeline for Real-Time Uber Data Using...Streaming Machine learning Distributed Pipeline for Real-Time Uber Data Using...
Streaming Machine learning Distributed Pipeline for Real-Time Uber Data Using...
Carol McDonald
 
Voxxed days thessaloniki 21/10/2016 - Streaming Engines for Big Data
Voxxed days thessaloniki 21/10/2016 - Streaming Engines for Big DataVoxxed days thessaloniki 21/10/2016 - Streaming Engines for Big Data
Voxxed days thessaloniki 21/10/2016 - Streaming Engines for Big Data
Stavros Kontopoulos
 
Voxxed Days Thesaloniki 2016 - Streaming Engines for Big Data
Voxxed Days Thesaloniki 2016 - Streaming Engines for Big DataVoxxed Days Thesaloniki 2016 - Streaming Engines for Big Data
Voxxed Days Thesaloniki 2016 - Streaming Engines for Big Data
Voxxed Days Thessaloniki
 
Hands-on - Machine Learning using scikitLearn
Hands-on - Machine Learning using scikitLearnHands-on - Machine Learning using scikitLearn
Hands-on - Machine Learning using scikitLearn
avrtraining021
 
Azure 機器學習 - 使用Python, R, Spark, CNTK 深度學習
Azure 機器學習 - 使用Python, R, Spark, CNTK 深度學習 Azure 機器學習 - 使用Python, R, Spark, CNTK 深度學習
Azure 機器學習 - 使用Python, R, Spark, CNTK 深度學習
Herman Wu
 
Using Graph Analysis and Fraud Detection in the Fintech Industry
Using Graph Analysis and Fraud Detection in the Fintech IndustryUsing Graph Analysis and Fraud Detection in the Fintech Industry
Using Graph Analysis and Fraud Detection in the Fintech Industry
Stanka Dalekova
 
Using Graph Analysis and Fraud Detection in the Fintech Industry
Using Graph Analysis and Fraud Detection in the Fintech IndustryUsing Graph Analysis and Fraud Detection in the Fintech Industry
Using Graph Analysis and Fraud Detection in the Fintech Industry
Stanka Dalekova
 
Ad

More from Jamal Sinclair O'Garro (15)

Intro to React
Intro to ReactIntro to React
Intro to React
Jamal Sinclair O'Garro
 
React + Redux for Web Developers
React + Redux for Web DevelopersReact + Redux for Web Developers
React + Redux for Web Developers
Jamal Sinclair O'Garro
 
Intro to ionic 2
Intro to ionic 2Intro to ionic 2
Intro to ionic 2
Jamal Sinclair O'Garro
 
Intro to ES6 / ES2015
Intro to ES6 / ES2015Intro to ES6 / ES2015
Intro to ES6 / ES2015
Jamal Sinclair O'Garro
 
The Ten Code Commandments
The Ten Code CommandmentsThe Ten Code Commandments
The Ten Code Commandments
Jamal Sinclair O'Garro
 
Using TypeScript with Angular
Using TypeScript with AngularUsing TypeScript with Angular
Using TypeScript with Angular
Jamal Sinclair O'Garro
 
Intro to UI-Router/TypeScript
Intro to UI-Router/TypeScriptIntro to UI-Router/TypeScript
Intro to UI-Router/TypeScript
Jamal Sinclair O'Garro
 
Intro to Node.js
Intro to Node.jsIntro to Node.js
Intro to Node.js
Jamal Sinclair O'Garro
 
Intro to iOS Development
Intro to iOS DevelopmentIntro to iOS Development
Intro to iOS Development
Jamal Sinclair O'Garro
 
Introduction to AngularJS
Introduction to AngularJSIntroduction to AngularJS
Introduction to AngularJS
Jamal Sinclair O'Garro
 
Intro to rails 2_kg_edited
Intro to rails 2_kg_editedIntro to rails 2_kg_edited
Intro to rails 2_kg_edited
Jamal Sinclair O'Garro
 
Intro to Ruby on Rails
Intro to Ruby on RailsIntro to Ruby on Rails
Intro to Ruby on Rails
Jamal Sinclair O'Garro
 
Intro to javascript (4 week)
Intro to javascript (4 week)Intro to javascript (4 week)
Intro to javascript (4 week)
Jamal Sinclair O'Garro
 
Intro to HTML + CSS
Intro to HTML + CSSIntro to HTML + CSS
Intro to HTML + CSS
Jamal Sinclair O'Garro
 
Intro to Programming
Intro to ProgrammingIntro to Programming
Intro to Programming
Jamal Sinclair O'Garro
 
Ad

Recently uploaded (20)

Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 
Heap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and DeletionHeap, Types of Heap, Insertion and Deletion
Heap, Types of Heap, Insertion and Deletion
Jaydeep Kale
 
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager APIUiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPath Community Berlin: Orchestrator API, Swagger, and Test Manager API
UiPathCommunity
 
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptxSpecial Meetup Edition - TDX Bengaluru Meetup #52.pptx
Special Meetup Edition - TDX Bengaluru Meetup #52.pptx
shyamraj55
 
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdfSAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
SAP Modernization: Maximizing the Value of Your SAP S/4HANA Migration.pdf
Precisely
 
Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025Splunk Security Update | Public Sector Summit Germany 2025
Splunk Security Update | Public Sector Summit Germany 2025
Splunk
 
Mobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi ArabiaMobile App Development Company in Saudi Arabia
Mobile App Development Company in Saudi Arabia
Steve Jonas
 
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul Shares 5 Steps to Implement AI Agents for Maximum Business Efficien...
Noah Loul
 
Build Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For DevsBuild Your Own Copilot & Agents For Devs
Build Your Own Copilot & Agents For Devs
Brian McKeiver
 
2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx2025-05-Q4-2024-Investor-Presentation.pptx
2025-05-Q4-2024-Investor-Presentation.pptx
Samuele Fogagnolo
 
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
#StandardsGoals for 2025: Standards & certification roundup - Tech Forum 2025
BookNet Canada
 
Cyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of securityCyber Awareness overview for 2025 month of security
Cyber Awareness overview for 2025 month of security
riccardosl1
 
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
AI EngineHost Review: Revolutionary USA Datacenter-Based Hosting with NVIDIA ...
SOFTTECHHUB
 
Generative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in BusinessGenerative Artificial Intelligence (GenAI) in Business
Generative Artificial Intelligence (GenAI) in Business
Dr. Tathagat Varma
 
Role of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered ManufacturingRole of Data Annotation Services in AI-Powered Manufacturing
Role of Data Annotation Services in AI-Powered Manufacturing
Andrew Leo
 
Rusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond SparkRusty Waters: Elevating Lakehouses Beyond Spark
Rusty Waters: Elevating Lakehouses Beyond Spark
carlyakerly1
 
Quantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur MorganQuantum Computing Quick Research Guide by Arthur Morgan
Quantum Computing Quick Research Guide by Arthur Morgan
Arthur Morgan
 
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
IEDM 2024 Tutorial2_Advances in CMOS Technologies and Future Directions for C...
organizerofv
 
Technology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data AnalyticsTechnology Trends in 2025: AI and Big Data Analytics
Technology Trends in 2025: AI and Big Data Analytics
InData Labs
 
Procurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptxProcurement Insights Cost To Value Guide.pptx
Procurement Insights Cost To Value Guide.pptx
Jon Hansen
 
How analogue intelligence complements AI
How analogue intelligence complements AIHow analogue intelligence complements AI
How analogue intelligence complements AI
Paul Rowe
 

A Look at TensorFlow.js

  • 1. A LOOK AT TENSORFLOW.JS Jamal O’Garro Software Engineer MEAN STACK NYC | MAY 17, 2018
  • 2. • Full-stack web-developer based in NYC • Professional Languages: JavaScript, Node, React, D3, TypeScript, Python • Hobby languages: Haskell, Golang • Mostly self-taught • Native New Yorker • Sneakerhead + Hip Hop Head • True Knicks fan MEAN STACK NYC | MAY 17, 2018 BIO
  • 3. • High level overview of deep learning and neural networks • Look at the TensorFlow.js API • Look at some examples provided by Google TODAY’S AGENDA MEAN STACK NYC | MAY 17, 2018
  • 4. • Comfortable with JavaScript • Familiar with ES6/ES7/ES8 syntax • Not going to assume you will get all of the theory (very little math!) ASSUMPTIONS MEAN STACK NYC | MAY 17, 2018
  • 5. MACHINE & DEEP LEARNING MEAN STACK NYC | MAY 17, 2018
  • 6. “Artificial intelligence (AI, also machine intelligence, MI) intelligence demonstrated by machines, in contrast to the natural intelligence (NI) displayed by humans and other animals. ” - Wikipedia WHAT IS ARTIFICIAL INTELLIGENCE? MEAN STACK NYC | MAY 17, 2018
  • 7. “Machine learning is a field of computer science that uses statistical techniques to give computer systems the ability to "learn" (e.g., progressively improve performance on a specific task) with data, without being explicitly programmed.” - Wikipedia WHAT IS MACHINE LEARNING? MEAN STACK NYC | MAY 17, 2018
  • 8. “Deep Learning is a subfield of machine learning concerned with algorithms inspired by the structure and function of the brain called artificial neural networks.” - Jason Brownlee, Machine Learning Mastery WHAT IS DEEP LEARNING? MEAN STACK NYC | MAY 17, 2018
  • 9. • Facebook Face Recognition • Amazon product recommendations • Netflix movie recommendations • Spotify music recommendations • Uber estimated time of arrival • Predicting stock price movements EXAMPLES OF ML IN THE WILD MEAN STACK NYC | MAY 17, 2018
  • 10. • Supervised Learning - learn how to classify or predict a value based on previous observations • Unsupervised Learning - find a pattern from existing data • Reinforcement Learning - provide positive or negative feedback based on expected outcome TYPES OF LEARNING MEAN STACK NYC | MAY 17, 2018
  • 11. NEURAL NETWORKS MEAN STACK NYC | MAY 17, 2018
  • 12. “Artificial neural networks (ANNs) or connectionist systems are computing systems vaguely inspired by the biological neural networks that constitute animal brains. Such systems "learn" (i.e. progressively improve performance on) tasks by considering examples, generally without task-specific programming.”  - Wikipedia WHAT IS A NEURAL NETWORK? MEAN STACK NYC | MAY 17, 2018
  • 13. • Dendrite - receives signals from another neuron • Neuron - processes the signal • Axon - transmits signals to another neuron BIOLOGICAL NEURAL NETWORK MEAN STACK NYC | MAY 17, 2018
  • 14. HUMAN NEURON DIAGRAM MEAN STACK NYC | MAY 17, 2018 - Wikipedia
  • 15. • Input layers - layer that contains our data that we want to learn from • Hidden layers - layers that sit between the input and output layers (process data and return and output) • Output layer - final output or estimate NEURAL NETWORK COMPONENTS MEAN STACK NYC | MAY 17, 2018
  • 16. NEURAL NETWORK DIAGRAM MEAN STACK NYC | MAY 17, 2018 - Wikipedia
  • 17. • Allow us to normalize our data • Sigmoid - normalizes value between 0 and 1 • ReLU - returns max of 0 and a value • tanh - normalizes value to between -1 and 1 ACTIVATION FUNCTIONS MEAN STACK NYC | MAY 17, 2018
  • 18. ACTIVATION FUNCTIONS - SIGMOID MEAN STACK NYC | MAY 17, 2018 - www.towardsdatascience.com
  • 19. ACTIVATION FUNCTIONS - ReLU MEAN STACK NYC | MAY 17, 2018 - www.towardsdatascience.com
  • 20. ACTIVATION FUNCTIONS - tanh MEAN STACK NYC | MAY 17, 2018 - www.towardsdatascience.com
  • 21. • Allow us to evaluate the performance of our model (how far off are our predictions from the actual observations) • Mean Squared Error - good choice for regression problems • Cross Entropy - good choice for classification problems COST FUNCTIONS MEAN STACK NYC | MAY 17, 2018
  • 22. COST FUNCTIONS - MEAN SQUARED ERROR MEAN STACK NYC | MAY 17, 2018 - Wikipedia
  • 23. COST FUNCTIONS - CROSS ENTROPY MEAN STACK NYC | MAY 17, 2018 - Wikipedia
  • 24. TRAINING MEAN STACK NYC | MAY 17, 2018 • The process of minimizing the errors between our predictions and our observations • Minimizing our cost function
  • 25. GRADIENT DESCENT MEAN STACK NYC | MAY 17, 2018 • Algorithm that allows us to find the minimum of a function • Take a guess along a curve or surface and take steps in the negative direction until we find a global minimum (i.e. dy/dx = 0) • Learning Rate - size of the steps we take when searching for our global minimum
  • 26. GRADIENT DESCENT DIAGRAM MEAN STACK NYC | MAY 17, 2018 - Wikipedia
  • 27. BACK PROPAGATION MEAN STACK NYC | MAY 17, 2018 • Calculates how much each predicted value contributes to an error • When we have an error we adjust the weights, biases, etc. of our neurons to reduce it (i.e. minimize the cost)
  • 28. TENSORFLOW MEAN STACK NYC | MAY 17, 2018
  • 29. WHAT IS TENSORFLOW? • Numerical computation library developed and open sourced by Google • Runs on CPU/GPU across clusters and sessions • Data flows through Tensors • Can create models and deploy to different production systems (Web, Mobile apps, etc.) • Written in C++ MEAN STACK NYC | MAY 17, 2018
  • 30. TENSORFLOW ECOSYSTEM MEAN STACK NYC | MAY 17, 2018
  • 32. TENSORFLOW.JS • Originally was deeplearning.js • Two APIs (Core + Layers) • Can build new models and retrain existing ones • Ability to load existing models for inference • Uses the computer’s GPU for both training and inference • Browser ready with active development on Node bindings MEAN STACK NYC | MAY 17, 2018
  • 33. • Tensor • Variable • Session • Layer • Model TENSORFLOW.JS TERMINOLOGY MEAN STACK NYC | MAY 17, 2018
  • 34. CORE API • Low-level operations • Linear Algebra transformations • Written in pure JavaScript • Targets the GPU via WebGL MEAN STACK NYC | MAY 17, 2018
  • 35. CORE API - TENSORS • Immutable data in our program • Scalar • Vector • Matrix MEAN STACK NYC | MAY 17, 2018
  • 36. CORE API - VARIABLES • Mutable data that can be reassigned during the life of our program MEAN STACK NYC | MAY 17, 2018
  • 37. CORE API - OPERATIONS • Allows us to manipulate our data • tf.add - adds two tensors • tf.sub - subtracts two tensors • tf.mul - multiplies two tensors • tf.div - divides two tensors • tf.maximum - returns the max of two tensors • tf.minimum - returns the min of two tensors MEAN STACK NYC | MAY 17, 2018
  • 38. CORE API MEAN STACK NYC | MAY 17, 2018
  • 39. LAYERS API • Inspired by Keras • Built on top of the Core API • High-level abstractions of neural network constructs MEAN STACK NYC | MAY 17, 2018
  • 40. LAYERS API - MODEL • A function when given some input will produce and output • tf.Model - basic unit of training • tf.Sequential - a model with a stack of layers feeding from one layer to the next MEAN STACK NYC | MAY 17, 2018
  • 41. LAYERS API - LAYER • Primary building block for building a model. Performs transformation to convert an input into an output. • tf.layers.activation - applies an activation function to a layer • tf.layers.dense - creates a fully connected layer • tf.layers.flatten - flattens input to one dimension • tf.layers.reshape - reshapes an input to a specified shape MEAN STACK NYC | MAY 17, 2018
  • 42. LAYERS API - CONFIG • Loss - the model’s loss function • Optimizer - algorithm that minimizes the error of our model • Metrics - list of metrics to be evaluated MEAN STACK NYC | MAY 17, 2018
  • 43. LAYERS API MEAN STACK NYC | MAY 17, 2018
  • 44. MEMORY MANAGEMENT • Must manage memory on the GPU when working with Tensors and variables • Easy to create memory leaks if you’re not careful • Tensor.dispose - disposes of a tensor • tf.tidy - provides a scope for us to run our program in and cleans up any tensors created during the process • Should be a synchronous function • Does not clean up variables (must dispose manually) • tf.keep - prevents a tensor created within a “tidy” block from being disposed MEAN STACK NYC | MAY 17, 2018
  • 45. • Can train new and retrain existing models in the browser • Can use existing models for inference in the browser • Soon we’ll be able to do this in Node! WHY IS THIS AWESOME? MEAN STACK NYC | MAY 17, 2018
  • 46. LET’S BUILD A BRAIN! MEAN STACK NYC | MAY 17, 2018
  • 47. RESOURCES MEAN STACK NYC | MAY 17, 2018
  • 48. RESOURCES Documentation • js.tensorflow.org • TensorFlow.js Github Repository • Google Developers Deep Learning Glossary Books • Deep Learning with Python - Francois Chollet • Learning from Data - Yaser S. Abu-Mostafa • Neural Networks and Deep Learning - Michael Nielsen Courses • Google's Deep Learning Crash Course • deeplearning.ai Tools • TensorFlow Playground Datasets • Kaggle MEAN STACK NYC | MAY 17, 2018
  • 49. THANK YOU!!! Jamal O’Garro Software Engineer + Instructor MEAN STACK NYC | MAY 17, 2018