SlideShare a Scribd company logo
Time Series Predictions
using Long Short-Term
Memory
Setu Chokshi
IoT Asia 2017 – 30th March
LSTMs are mainstream
What are Neural Network
Y1
Y2
X1
X2
X3
h1
h2
h3
h4
Information Transfer
Input Values
Calculator – Activations
Output (Activation)
1
2
3
4
Input Hidden Output
X1
X2
X3
W11
W21
W31
 
h1
Example of  = REctified Linear Unit =
max(0,input)
Strengthen weak signals; Leave strong
signals alone
Weight is the strength of the connection
between nodes
1
Challenges
 Only fixed sized inputs & outputs
 Performs mapping of features from input to output
 No memory and hence difficult to model time series
Lets add some memory
Input Hidden Output
Input + prevInput Hidden Output Input+ prevHidden Hidden Output
Input + prevInput Hidden Output
Input + prevInput Hidden Output
Input + prevInput Hidden Output
Input + prevInput Hidden Output
Input + prevHidden Hidden Output
Input + prevHidden Hidden Output
Input + prevHidden Hidden Output
Input + prevHidden Hidden Output
Approach 1: Add previous inputs Approach 2: Add previous hidden
Lets do 4 time series steps Lets do 4 time series steps
Lets add some memory…and color
Input Hidden Output
Input + prevInput Hidden Output Input+ prevHidden Hidden Output
Input + prevInput Hidden Output
Input + prevInput Hidden Output
Input + prevInput Hidden Output
Input + prevInput Hidden Output
Input + prevHidden Hidden Output
Input + prevHidden Hidden Output
Input + prevHidden Hidden Output
Input + prevHidden Hidden Output
Approach 1: Add previous inputs Approach 2: Add previous hidden
Lets do 4 time series steps Lets do 4 time series steps
Lets build an LSTM
Xt
   
0 1 2 3
ht-1
Ct-1 Ct✖
✖

✖σ σ σtanh
tanh
ht
ht
Ct-1
Now lets build an LSTM
Element-
wise
Summation
/
Concatenati
on
Element-
wise
multiplicatio
n
X
t
ht-
1
Ct-
1
h
t
C
t
0
σ

✖
tanh
Inputs: Outputs:
Input vector
Memory
from
previous
blockOutput of
previous
block
Memory
from
current
blockOutput of
current
block
Nonlinearities:
Sigmoid
Hyperbolic
tangent
Vector
operations:
Bias:
Lets skip the math, ok?
Element-
wise
summation
Element-
wise
multiplicatio
n
✖ = =
Memory Pipeline
Xt
   
0 1 2 3
ht-1
Ct-1
C
t
ht
✖
✖

✖σ σ σtanh
tanh
ht
✖
Forget Layer
Xt
   
0 1 2 3
ht-1
Ct-1 Ct
ht
✖
✖

✖σ σ σtanh
tanh
ht
Generate new memories: Input
Xt
  + 
0 1 2 3
ht-1
Ct-1 Ct
ht
✖
✖

✖σ σ σtanh
tanh
ht

2
tanh
Generate new memories: Candidate
Xt
   
0 1 2 3
ht-1
Ct-1 Ct
ht
✖
✖

✖σ σ σtanh
tanh
ht
Memory Pipeline
Xt
   
0 1 2 3
ht-1
Ct-1 Ct
ht
✖
✖

✖σ σ σtanh
tanh
ht
Generate the output
Xt
   
0 1 2 3
ht-1
Ct-1 Ct
ht
✖
✖

✖σ σ σtanh
tanh
ht
EXAMPLES
Sin wave predictor
 Generate sin curve
 Load 5000 X 50
sequences
 90:10 split on train/test
sets
Power Consumption Dataset
 Power Consumption
Dataset
 47 Months of data
 2075259 measurements
 Active energy consumed
per min
 Load 4567 X 50
sequences
 90:10 split on train/test
sets
References
 Understanding LSTM Networks
http://colah.github.io/posts/2015-08-Understanding-
LSTMs/
 General Sequence Learning using Recurrent
Neural Networks
https://www.youtube.com/watch?v=VINCQghQRuM
 Recurrent Neural Networks Part 1: Theory
https://www.slideshare.net/gakhov
 Facebook Prophet
https://github.com/facebookincubator/prophet
 Images adapted from Shi Yan
https://medium.com/@shiyan/understanding-lstm-and-its-
diagrams-37e2f46f1714
 Anyone Can Learn To Code
https://iamtrask.github.io/2015/11/15/anyone-can-code-lstm/
THANK YOU
@setuc
www.linkedin.com/in/setuchoks
hi/
github.com/setuc/iotAsia2017

More Related Content

What's hot

Introduction to Recurrent Neural Network
Introduction to Recurrent Neural NetworkIntroduction to Recurrent Neural Network
Introduction to Recurrent Neural Network
Yan Xu
 
Rnn and lstm
Rnn and lstmRnn and lstm
Rnn and lstm
Shreshth Saxena
 
Recurrent Neural Networks, LSTM and GRU
Recurrent Neural Networks, LSTM and GRURecurrent Neural Networks, LSTM and GRU
Recurrent Neural Networks, LSTM and GRU
ananth
 
Recurrent Neural Network (RNN) | RNN LSTM Tutorial | Deep Learning Course | S...
Recurrent Neural Network (RNN) | RNN LSTM Tutorial | Deep Learning Course | S...Recurrent Neural Network (RNN) | RNN LSTM Tutorial | Deep Learning Course | S...
Recurrent Neural Network (RNN) | RNN LSTM Tutorial | Deep Learning Course | S...
Simplilearn
 
Recurrent Neural Networks. Part 1: Theory
Recurrent Neural Networks. Part 1: TheoryRecurrent Neural Networks. Part 1: Theory
Recurrent Neural Networks. Part 1: Theory
Andrii Gakhov
 
Time series deep learning
Time series   deep learningTime series   deep learning
Time series deep learning
Alberto Arrigoni
 
RNNs for Timeseries Analysis
RNNs for Timeseries AnalysisRNNs for Timeseries Analysis
RNNs for Timeseries Analysis
Bruno Gonçalves
 
Deep Learning: Recurrent Neural Network (Chapter 10)
Deep Learning: Recurrent Neural Network (Chapter 10) Deep Learning: Recurrent Neural Network (Chapter 10)
Deep Learning: Recurrent Neural Network (Chapter 10)
Larry Guo
 
Vanishing & Exploding Gradients
Vanishing & Exploding GradientsVanishing & Exploding Gradients
Vanishing & Exploding Gradients
Siddharth Vij
 
Recurrent Neural Networks (RNNs)
Recurrent Neural Networks (RNNs)Recurrent Neural Networks (RNNs)
Recurrent Neural Networks (RNNs)
Abdullah al Mamun
 
RNN & LSTM: Neural Network for Sequential Data
RNN & LSTM: Neural Network for Sequential DataRNN & LSTM: Neural Network for Sequential Data
RNN & LSTM: Neural Network for Sequential Data
Yao-Chieh Hu
 
Recurrent neural networks rnn
Recurrent neural networks   rnnRecurrent neural networks   rnn
Recurrent neural networks rnn
Kuppusamy P
 
Long Short Term Memory LSTM
Long Short Term Memory LSTMLong Short Term Memory LSTM
Long Short Term Memory LSTM
Abdullah al Mamun
 
Reinforcement learning
Reinforcement learningReinforcement learning
Reinforcement learning
Ding Li
 
Deep learning and feature extraction for time series forecasting
Deep learning and feature extraction for time series forecastingDeep learning and feature extraction for time series forecasting
Deep learning and feature extraction for time series forecasting
Pavel Filonov
 
Introduction to Transformer Model
Introduction to Transformer ModelIntroduction to Transformer Model
Introduction to Transformer Model
Nuwan Sriyantha Bandara
 
Informed search
Informed searchInformed search
Informed search
Amit Kumar Rathi
 
An Introduction to Long Short-term Memory (LSTMs)
An Introduction to Long Short-term Memory (LSTMs)An Introduction to Long Short-term Memory (LSTMs)
An Introduction to Long Short-term Memory (LSTMs)
EmmanuelJosterSsenjo
 

What's hot (20)

Introduction to Recurrent Neural Network
Introduction to Recurrent Neural NetworkIntroduction to Recurrent Neural Network
Introduction to Recurrent Neural Network
 
Rnn and lstm
Rnn and lstmRnn and lstm
Rnn and lstm
 
Recurrent Neural Networks, LSTM and GRU
Recurrent Neural Networks, LSTM and GRURecurrent Neural Networks, LSTM and GRU
Recurrent Neural Networks, LSTM and GRU
 
Recurrent Neural Network (RNN) | RNN LSTM Tutorial | Deep Learning Course | S...
Recurrent Neural Network (RNN) | RNN LSTM Tutorial | Deep Learning Course | S...Recurrent Neural Network (RNN) | RNN LSTM Tutorial | Deep Learning Course | S...
Recurrent Neural Network (RNN) | RNN LSTM Tutorial | Deep Learning Course | S...
 
Recurrent Neural Networks. Part 1: Theory
Recurrent Neural Networks. Part 1: TheoryRecurrent Neural Networks. Part 1: Theory
Recurrent Neural Networks. Part 1: Theory
 
Recurrent neural network
Recurrent neural networkRecurrent neural network
Recurrent neural network
 
Time series deep learning
Time series   deep learningTime series   deep learning
Time series deep learning
 
RNNs for Timeseries Analysis
RNNs for Timeseries AnalysisRNNs for Timeseries Analysis
RNNs for Timeseries Analysis
 
Deep Learning: Recurrent Neural Network (Chapter 10)
Deep Learning: Recurrent Neural Network (Chapter 10) Deep Learning: Recurrent Neural Network (Chapter 10)
Deep Learning: Recurrent Neural Network (Chapter 10)
 
Vanishing & Exploding Gradients
Vanishing & Exploding GradientsVanishing & Exploding Gradients
Vanishing & Exploding Gradients
 
Recurrent Neural Networks (RNNs)
Recurrent Neural Networks (RNNs)Recurrent Neural Networks (RNNs)
Recurrent Neural Networks (RNNs)
 
RNN & LSTM: Neural Network for Sequential Data
RNN & LSTM: Neural Network for Sequential DataRNN & LSTM: Neural Network for Sequential Data
RNN & LSTM: Neural Network for Sequential Data
 
rnn BASICS
rnn BASICSrnn BASICS
rnn BASICS
 
Recurrent neural networks rnn
Recurrent neural networks   rnnRecurrent neural networks   rnn
Recurrent neural networks rnn
 
Long Short Term Memory LSTM
Long Short Term Memory LSTMLong Short Term Memory LSTM
Long Short Term Memory LSTM
 
Reinforcement learning
Reinforcement learningReinforcement learning
Reinforcement learning
 
Deep learning and feature extraction for time series forecasting
Deep learning and feature extraction for time series forecastingDeep learning and feature extraction for time series forecasting
Deep learning and feature extraction for time series forecasting
 
Introduction to Transformer Model
Introduction to Transformer ModelIntroduction to Transformer Model
Introduction to Transformer Model
 
Informed search
Informed searchInformed search
Informed search
 
An Introduction to Long Short-term Memory (LSTMs)
An Introduction to Long Short-term Memory (LSTMs)An Introduction to Long Short-term Memory (LSTMs)
An Introduction to Long Short-term Memory (LSTMs)
 

Viewers also liked

Machine Learning 101
Machine Learning 101Machine Learning 101
Machine Learning 101
Setu Chokshi
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
Leslie Samuel
 
Project Management Trends 2017
Project Management Trends 2017Project Management Trends 2017
Project Management Trends 2017
Syed Nazir Razik ACP, CSM, PMP
 
DATA, CREATIVITY & INSIGHT - Killing the misconception that data is the enemy...
DATA, CREATIVITY & INSIGHT - Killing the misconception that data is the enemy...DATA, CREATIVITY & INSIGHT - Killing the misconception that data is the enemy...
DATA, CREATIVITY & INSIGHT - Killing the misconception that data is the enemy...
Komfo
 
Implementing a Fileserver with Nginx and Lua
Implementing a Fileserver with Nginx and LuaImplementing a Fileserver with Nginx and Lua
Implementing a Fileserver with Nginx and Lua
Andrii Gakhov
 
Product Management 101
Product Management 101Product Management 101
Product Management 101
Amit Ranjan
 
Data and Creativity - A Content Marketing Winning Formula - SASCon 2016
Data and Creativity - A Content Marketing Winning Formula - SASCon 2016Data and Creativity - A Content Marketing Winning Formula - SASCon 2016
Data and Creativity - A Content Marketing Winning Formula - SASCon 2016
Stacey MacNaught
 
Technology, creativity & data: How to tell your story, engage your audience a...
Technology, creativity & data: How to tell your story, engage your audience a...Technology, creativity & data: How to tell your story, engage your audience a...
Technology, creativity & data: How to tell your story, engage your audience a...
Rapt Media
 
Startup/Digital Marketing 2.0: Growth Hacking Thru UX
Startup/Digital Marketing 2.0: Growth Hacking Thru UXStartup/Digital Marketing 2.0: Growth Hacking Thru UX
Startup/Digital Marketing 2.0: Growth Hacking Thru UX
Soon-Aik Chiew
 
Best Practice For UX Deliverables - Eventhandler, London, 05 March 2014
Best Practice For UX Deliverables - Eventhandler, London, 05 March 2014Best Practice For UX Deliverables - Eventhandler, London, 05 March 2014
Best Practice For UX Deliverables - Eventhandler, London, 05 March 2014
Anna Dahlström
 
SCK :: Scrum is NOT Enough
SCK :: Scrum is NOT EnoughSCK :: Scrum is NOT Enough
SCK :: Scrum is NOT Enough
Somkiat Puisungnoen
 
UX Design + UI Design: Injecting a brand persona!
UX Design + UI Design: Injecting a brand persona!UX Design + UI Design: Injecting a brand persona!
UX Design + UI Design: Injecting a brand persona!
Jayan Narayanan
 
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika AldabaLightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
ux singapore
 
Product Manager 101: What Does A Product Manager Actually Do?
Product Manager 101: What Does A Product Manager Actually Do?Product Manager 101: What Does A Product Manager Actually Do?
Product Manager 101: What Does A Product Manager Actually Do?
Chris Cummings
 
SXSW 2016: The Need To Knows
SXSW 2016: The Need To KnowsSXSW 2016: The Need To Knows
SXSW 2016: The Need To Knows
Ogilvy Consulting
 
[Infographic] How will Internet of Things (IoT) change the world as we know it?
[Infographic] How will Internet of Things (IoT) change the world as we know it?[Infographic] How will Internet of Things (IoT) change the world as we know it?
[Infographic] How will Internet of Things (IoT) change the world as we know it?
InterQuest Group
 
Mobile-First SEO - The Marketers Edition #3XEDigital
Mobile-First SEO - The Marketers Edition #3XEDigitalMobile-First SEO - The Marketers Edition #3XEDigital
Mobile-First SEO - The Marketers Edition #3XEDigital
Aleyda Solís
 

Viewers also liked (17)

Machine Learning 101
Machine Learning 101Machine Learning 101
Machine Learning 101
 
How to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your NicheHow to Become a Thought Leader in Your Niche
How to Become a Thought Leader in Your Niche
 
Project Management Trends 2017
Project Management Trends 2017Project Management Trends 2017
Project Management Trends 2017
 
DATA, CREATIVITY & INSIGHT - Killing the misconception that data is the enemy...
DATA, CREATIVITY & INSIGHT - Killing the misconception that data is the enemy...DATA, CREATIVITY & INSIGHT - Killing the misconception that data is the enemy...
DATA, CREATIVITY & INSIGHT - Killing the misconception that data is the enemy...
 
Implementing a Fileserver with Nginx and Lua
Implementing a Fileserver with Nginx and LuaImplementing a Fileserver with Nginx and Lua
Implementing a Fileserver with Nginx and Lua
 
Product Management 101
Product Management 101Product Management 101
Product Management 101
 
Data and Creativity - A Content Marketing Winning Formula - SASCon 2016
Data and Creativity - A Content Marketing Winning Formula - SASCon 2016Data and Creativity - A Content Marketing Winning Formula - SASCon 2016
Data and Creativity - A Content Marketing Winning Formula - SASCon 2016
 
Technology, creativity & data: How to tell your story, engage your audience a...
Technology, creativity & data: How to tell your story, engage your audience a...Technology, creativity & data: How to tell your story, engage your audience a...
Technology, creativity & data: How to tell your story, engage your audience a...
 
Startup/Digital Marketing 2.0: Growth Hacking Thru UX
Startup/Digital Marketing 2.0: Growth Hacking Thru UXStartup/Digital Marketing 2.0: Growth Hacking Thru UX
Startup/Digital Marketing 2.0: Growth Hacking Thru UX
 
Best Practice For UX Deliverables - Eventhandler, London, 05 March 2014
Best Practice For UX Deliverables - Eventhandler, London, 05 March 2014Best Practice For UX Deliverables - Eventhandler, London, 05 March 2014
Best Practice For UX Deliverables - Eventhandler, London, 05 March 2014
 
SCK :: Scrum is NOT Enough
SCK :: Scrum is NOT EnoughSCK :: Scrum is NOT Enough
SCK :: Scrum is NOT Enough
 
UX Design + UI Design: Injecting a brand persona!
UX Design + UI Design: Injecting a brand persona!UX Design + UI Design: Injecting a brand persona!
UX Design + UI Design: Injecting a brand persona!
 
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika AldabaLightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
Lightning Talk #9: How UX and Data Storytelling Can Shape Policy by Mika Aldaba
 
Product Manager 101: What Does A Product Manager Actually Do?
Product Manager 101: What Does A Product Manager Actually Do?Product Manager 101: What Does A Product Manager Actually Do?
Product Manager 101: What Does A Product Manager Actually Do?
 
SXSW 2016: The Need To Knows
SXSW 2016: The Need To KnowsSXSW 2016: The Need To Knows
SXSW 2016: The Need To Knows
 
[Infographic] How will Internet of Things (IoT) change the world as we know it?
[Infographic] How will Internet of Things (IoT) change the world as we know it?[Infographic] How will Internet of Things (IoT) change the world as we know it?
[Infographic] How will Internet of Things (IoT) change the world as we know it?
 
Mobile-First SEO - The Marketers Edition #3XEDigital
Mobile-First SEO - The Marketers Edition #3XEDigitalMobile-First SEO - The Marketers Edition #3XEDigital
Mobile-First SEO - The Marketers Edition #3XEDigital
 

Similar to Time series predictions using LSTMs

streamingalgo88585858585858585pppppp.pptx
streamingalgo88585858585858585pppppp.pptxstreamingalgo88585858585858585pppppp.pptx
streamingalgo88585858585858585pppppp.pptx
GopiNathVelivela
 
Hardware Acceleration for Machine Learning
Hardware Acceleration for Machine LearningHardware Acceleration for Machine Learning
Hardware Acceleration for Machine Learning
CastLabKAIST
 
Options and trade offs for parallelism and concurrency in Modern C++
Options and trade offs for parallelism and concurrency in Modern C++Options and trade offs for parallelism and concurrency in Modern C++
Options and trade offs for parallelism and concurrency in Modern C++
Satalia
 
Deep learning from scratch
Deep learning from scratch Deep learning from scratch
Deep learning from scratch
Eran Shlomo
 
Simple, fast, and scalable torch7 tutorial
Simple, fast, and scalable torch7 tutorialSimple, fast, and scalable torch7 tutorial
Simple, fast, and scalable torch7 tutorial
Jin-Hwa Kim
 
Convex Optimization Modelling with CVXOPT
Convex Optimization Modelling with CVXOPTConvex Optimization Modelling with CVXOPT
Convex Optimization Modelling with CVXOPT
andrewmart11
 
On Mining Bitcoins - Fundamentals & Outlooks
On Mining Bitcoins - Fundamentals & OutlooksOn Mining Bitcoins - Fundamentals & Outlooks
On Mining Bitcoins - Fundamentals & Outlooks
Filip Maertens
 
nand2tetris 舊版投影片 -- 第二章 布林算術
nand2tetris 舊版投影片 -- 第二章 布林算術nand2tetris 舊版投影片 -- 第二章 布林算術
nand2tetris 舊版投影片 -- 第二章 布林算術
鍾誠 陳鍾誠
 
Enabling Power-Efficient AI Through Quantization
Enabling Power-Efficient AI Through QuantizationEnabling Power-Efficient AI Through Quantization
Enabling Power-Efficient AI Through Quantization
Qualcomm Research
 
Cryptography 202
Cryptography 202Cryptography 202
Cryptography 202
UTD Computer Security Group
 
Introduction to Neural Networks and Deep Learning
Introduction to Neural Networks and Deep LearningIntroduction to Neural Networks and Deep Learning
Introduction to Neural Networks and Deep Learning
Vahid Mirjalili
 
Digit recognizer by convolutional neural network
Digit recognizer by convolutional neural networkDigit recognizer by convolutional neural network
Digit recognizer by convolutional neural network
Ding Li
 
Probabilistic data structures. Part 3. Frequency
Probabilistic data structures. Part 3. FrequencyProbabilistic data structures. Part 3. Frequency
Probabilistic data structures. Part 3. Frequency
Andrii Gakhov
 
[DSC 2016] 系列活動:李宏毅 / 一天搞懂深度學習
[DSC 2016] 系列活動:李宏毅 / 一天搞懂深度學習[DSC 2016] 系列活動:李宏毅 / 一天搞懂深度學習
[DSC 2016] 系列活動:李宏毅 / 一天搞懂深度學習
台灣資料科學年會
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
vishnu973656
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
Rvishnupriya2
 
Recurrent Neural Networks I (D2L2 Deep Learning for Speech and Language UPC 2...
Recurrent Neural Networks I (D2L2 Deep Learning for Speech and Language UPC 2...Recurrent Neural Networks I (D2L2 Deep Learning for Speech and Language UPC 2...
Recurrent Neural Networks I (D2L2 Deep Learning for Speech and Language UPC 2...
Universitat Politècnica de Catalunya
 
Binary parallel adder, decimal adder
Binary parallel adder, decimal adderBinary parallel adder, decimal adder
Binary parallel adder, decimal adder
shahzad ali
 
Towards typesafe deep learning in scala
Towards typesafe deep learning in scalaTowards typesafe deep learning in scala
Towards typesafe deep learning in scala
Tongfei Chen
 

Similar to Time series predictions using LSTMs (20)

streamingalgo88585858585858585pppppp.pptx
streamingalgo88585858585858585pppppp.pptxstreamingalgo88585858585858585pppppp.pptx
streamingalgo88585858585858585pppppp.pptx
 
Hardware Acceleration for Machine Learning
Hardware Acceleration for Machine LearningHardware Acceleration for Machine Learning
Hardware Acceleration for Machine Learning
 
Options and trade offs for parallelism and concurrency in Modern C++
Options and trade offs for parallelism and concurrency in Modern C++Options and trade offs for parallelism and concurrency in Modern C++
Options and trade offs for parallelism and concurrency in Modern C++
 
Deep learning from scratch
Deep learning from scratch Deep learning from scratch
Deep learning from scratch
 
Simple, fast, and scalable torch7 tutorial
Simple, fast, and scalable torch7 tutorialSimple, fast, and scalable torch7 tutorial
Simple, fast, and scalable torch7 tutorial
 
Convex Optimization Modelling with CVXOPT
Convex Optimization Modelling with CVXOPTConvex Optimization Modelling with CVXOPT
Convex Optimization Modelling with CVXOPT
 
On Mining Bitcoins - Fundamentals & Outlooks
On Mining Bitcoins - Fundamentals & OutlooksOn Mining Bitcoins - Fundamentals & Outlooks
On Mining Bitcoins - Fundamentals & Outlooks
 
nand2tetris 舊版投影片 -- 第二章 布林算術
nand2tetris 舊版投影片 -- 第二章 布林算術nand2tetris 舊版投影片 -- 第二章 布林算術
nand2tetris 舊版投影片 -- 第二章 布林算術
 
Enabling Power-Efficient AI Through Quantization
Enabling Power-Efficient AI Through QuantizationEnabling Power-Efficient AI Through Quantization
Enabling Power-Efficient AI Through Quantization
 
Cryptography 202
Cryptography 202Cryptography 202
Cryptography 202
 
Introduction to Neural Networks and Deep Learning
Introduction to Neural Networks and Deep LearningIntroduction to Neural Networks and Deep Learning
Introduction to Neural Networks and Deep Learning
 
Digit recognizer by convolutional neural network
Digit recognizer by convolutional neural networkDigit recognizer by convolutional neural network
Digit recognizer by convolutional neural network
 
Probabilistic data structures. Part 3. Frequency
Probabilistic data structures. Part 3. FrequencyProbabilistic data structures. Part 3. Frequency
Probabilistic data structures. Part 3. Frequency
 
[DSC 2016] 系列活動:李宏毅 / 一天搞懂深度學習
[DSC 2016] 系列活動:李宏毅 / 一天搞懂深度學習[DSC 2016] 系列活動:李宏毅 / 一天搞懂深度學習
[DSC 2016] 系列活動:李宏毅 / 一天搞懂深度學習
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 
Computer architecture
Computer architectureComputer architecture
Computer architecture
 
Recurrent Neural Networks I (D2L2 Deep Learning for Speech and Language UPC 2...
Recurrent Neural Networks I (D2L2 Deep Learning for Speech and Language UPC 2...Recurrent Neural Networks I (D2L2 Deep Learning for Speech and Language UPC 2...
Recurrent Neural Networks I (D2L2 Deep Learning for Speech and Language UPC 2...
 
Binary parallel adder, decimal adder
Binary parallel adder, decimal adderBinary parallel adder, decimal adder
Binary parallel adder, decimal adder
 
Towards typesafe deep learning in scala
Towards typesafe deep learning in scalaTowards typesafe deep learning in scala
Towards typesafe deep learning in scala
 
Chapter1
Chapter1Chapter1
Chapter1
 

More from Setu Chokshi

Build vs Buy: Ensuring maximum ROI from AI
Build vs Buy: Ensuring maximum ROI from AIBuild vs Buy: Ensuring maximum ROI from AI
Build vs Buy: Ensuring maximum ROI from AI
Setu Chokshi
 
AI for AI: Building state of the art models
AI for AI: Building state of the art modelsAI for AI: Building state of the art models
AI for AI: Building state of the art models
Setu Chokshi
 
Microsoft Introduction to Automated Machine Learning
Microsoft Introduction to Automated Machine LearningMicrosoft Introduction to Automated Machine Learning
Microsoft Introduction to Automated Machine Learning
Setu Chokshi
 
2018 Global Azure Bootcamp Azure Machine Learning for neural networks
2018 Global Azure Bootcamp Azure Machine Learning for neural networks2018 Global Azure Bootcamp Azure Machine Learning for neural networks
2018 Global Azure Bootcamp Azure Machine Learning for neural networks
Setu Chokshi
 
Azure machine learning 101 Parts 1 & 2 - Classification Algorithms
Azure machine learning 101  Parts 1 & 2  -  Classification Algorithms Azure machine learning 101  Parts 1 & 2  -  Classification Algorithms
Azure machine learning 101 Parts 1 & 2 - Classification Algorithms
Setu Chokshi
 
Azure machine learning 101 - Part 1
Azure machine learning 101 - Part 1Azure machine learning 101 - Part 1
Azure machine learning 101 - Part 1
Setu Chokshi
 
Analysis on the US Consumer Expenditure
Analysis on the US Consumer ExpenditureAnalysis on the US Consumer Expenditure
Analysis on the US Consumer Expenditure
Setu Chokshi
 
Azure Boot Camp 2017 getting started with azure machine learning
Azure Boot Camp 2017 getting started with azure machine learningAzure Boot Camp 2017 getting started with azure machine learning
Azure Boot Camp 2017 getting started with azure machine learning
Setu Chokshi
 

More from Setu Chokshi (8)

Build vs Buy: Ensuring maximum ROI from AI
Build vs Buy: Ensuring maximum ROI from AIBuild vs Buy: Ensuring maximum ROI from AI
Build vs Buy: Ensuring maximum ROI from AI
 
AI for AI: Building state of the art models
AI for AI: Building state of the art modelsAI for AI: Building state of the art models
AI for AI: Building state of the art models
 
Microsoft Introduction to Automated Machine Learning
Microsoft Introduction to Automated Machine LearningMicrosoft Introduction to Automated Machine Learning
Microsoft Introduction to Automated Machine Learning
 
2018 Global Azure Bootcamp Azure Machine Learning for neural networks
2018 Global Azure Bootcamp Azure Machine Learning for neural networks2018 Global Azure Bootcamp Azure Machine Learning for neural networks
2018 Global Azure Bootcamp Azure Machine Learning for neural networks
 
Azure machine learning 101 Parts 1 & 2 - Classification Algorithms
Azure machine learning 101  Parts 1 & 2  -  Classification Algorithms Azure machine learning 101  Parts 1 & 2  -  Classification Algorithms
Azure machine learning 101 Parts 1 & 2 - Classification Algorithms
 
Azure machine learning 101 - Part 1
Azure machine learning 101 - Part 1Azure machine learning 101 - Part 1
Azure machine learning 101 - Part 1
 
Analysis on the US Consumer Expenditure
Analysis on the US Consumer ExpenditureAnalysis on the US Consumer Expenditure
Analysis on the US Consumer Expenditure
 
Azure Boot Camp 2017 getting started with azure machine learning
Azure Boot Camp 2017 getting started with azure machine learningAzure Boot Camp 2017 getting started with azure machine learning
Azure Boot Camp 2017 getting started with azure machine learning
 

Recently uploaded

RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
KAMESHS29
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
Adtran
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
KatiaHIMEUR1
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
Guy Korland
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
Octavian Nadolu
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
Ana-Maria Mihalceanu
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
Aftab Hussain
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
SOFTTECHHUB
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
ControlCase
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Paige Cruz
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
DanBrown980551
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
SOFTTECHHUB
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
mikeeftimakis1
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Vladimir Iglovikov, Ph.D.
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
Neo4j
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
Neo4j
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
danishmna97
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
Neo4j
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Aggregage
 

Recently uploaded (20)

RESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for studentsRESUME BUILDER APPLICATION Project for students
RESUME BUILDER APPLICATION Project for students
 
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdfFIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
FIDO Alliance Osaka Seminar: The WebAuthn API and Discoverable Credentials.pdf
 
Pushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 daysPushing the limits of ePRTC: 100ns holdover for 100 days
Pushing the limits of ePRTC: 100ns holdover for 100 days
 
Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !Securing your Kubernetes cluster_ a step-by-step guide to success !
Securing your Kubernetes cluster_ a step-by-step guide to success !
 
GraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge GraphGraphRAG is All You need? LLM & Knowledge Graph
GraphRAG is All You need? LLM & Knowledge Graph
 
Artificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopmentArtificial Intelligence for XMLDevelopment
Artificial Intelligence for XMLDevelopment
 
Monitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR EventsMonitoring Java Application Security with JDK Tools and JFR Events
Monitoring Java Application Security with JDK Tools and JFR Events
 
Removing Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software FuzzingRemoving Uninteresting Bytes in Software Fuzzing
Removing Uninteresting Bytes in Software Fuzzing
 
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
Why You Should Replace Windows 11 with Nitrux Linux 3.5.0 for enhanced perfor...
 
PCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase TeamPCI PIN Basics Webinar from the Controlcase Team
PCI PIN Basics Webinar from the Controlcase Team
 
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdfObservability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
Observability Concepts EVERY Developer Should Know -- DeveloperWeek Europe.pdf
 
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
LF Energy Webinar: Electrical Grid Modelling and Simulation Through PowSyBl -...
 
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
Goodbye Windows 11: Make Way for Nitrux Linux 3.5.0!
 
Introduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - CybersecurityIntroduction to CHERI technology - Cybersecurity
Introduction to CHERI technology - Cybersecurity
 
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AIEnchancing adoption of Open Source Libraries. A case study on Albumentations.AI
Enchancing adoption of Open Source Libraries. A case study on Albumentations.AI
 
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
GraphSummit Singapore | The Future of Agility: Supercharging Digital Transfor...
 
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
GraphSummit Singapore | Enhancing Changi Airport Group's Passenger Experience...
 
How to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptxHow to Get CNIC Information System with Paksim Ga.pptx
How to Get CNIC Information System with Paksim Ga.pptx
 
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024GraphSummit Singapore | The Art of the  Possible with Graph - Q2 2024
GraphSummit Singapore | The Art of the Possible with Graph - Q2 2024
 
Generative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to ProductionGenerative AI Deep Dive: Advancing from Proof of Concept to Production
Generative AI Deep Dive: Advancing from Proof of Concept to Production
 

Time series predictions using LSTMs

  • 1. Time Series Predictions using Long Short-Term Memory Setu Chokshi IoT Asia 2017 – 30th March
  • 3. What are Neural Network Y1 Y2 X1 X2 X3 h1 h2 h3 h4 Information Transfer Input Values Calculator – Activations Output (Activation) 1 2 3 4 Input Hidden Output X1 X2 X3 W11 W21 W31   h1 Example of  = REctified Linear Unit = max(0,input) Strengthen weak signals; Leave strong signals alone Weight is the strength of the connection between nodes 1
  • 4. Challenges  Only fixed sized inputs & outputs  Performs mapping of features from input to output  No memory and hence difficult to model time series
  • 5. Lets add some memory Input Hidden Output Input + prevInput Hidden Output Input+ prevHidden Hidden Output Input + prevInput Hidden Output Input + prevInput Hidden Output Input + prevInput Hidden Output Input + prevInput Hidden Output Input + prevHidden Hidden Output Input + prevHidden Hidden Output Input + prevHidden Hidden Output Input + prevHidden Hidden Output Approach 1: Add previous inputs Approach 2: Add previous hidden Lets do 4 time series steps Lets do 4 time series steps
  • 6. Lets add some memory…and color Input Hidden Output Input + prevInput Hidden Output Input+ prevHidden Hidden Output Input + prevInput Hidden Output Input + prevInput Hidden Output Input + prevInput Hidden Output Input + prevInput Hidden Output Input + prevHidden Hidden Output Input + prevHidden Hidden Output Input + prevHidden Hidden Output Input + prevHidden Hidden Output Approach 1: Add previous inputs Approach 2: Add previous hidden Lets do 4 time series steps Lets do 4 time series steps
  • 7. Lets build an LSTM Xt     0 1 2 3 ht-1 Ct-1 Ct✖ ✖  ✖σ σ σtanh tanh ht ht Ct-1
  • 8. Now lets build an LSTM Element- wise Summation / Concatenati on Element- wise multiplicatio n X t ht- 1 Ct- 1 h t C t 0 σ  ✖ tanh Inputs: Outputs: Input vector Memory from previous blockOutput of previous block Memory from current blockOutput of current block Nonlinearities: Sigmoid Hyperbolic tangent Vector operations: Bias:
  • 9. Lets skip the math, ok? Element- wise summation Element- wise multiplicatio n ✖ = =
  • 10. Memory Pipeline Xt     0 1 2 3 ht-1 Ct-1 C t ht ✖ ✖  ✖σ σ σtanh tanh ht ✖
  • 11. Forget Layer Xt     0 1 2 3 ht-1 Ct-1 Ct ht ✖ ✖  ✖σ σ σtanh tanh ht
  • 12. Generate new memories: Input Xt   +  0 1 2 3 ht-1 Ct-1 Ct ht ✖ ✖  ✖σ σ σtanh tanh ht  2 tanh
  • 13. Generate new memories: Candidate Xt     0 1 2 3 ht-1 Ct-1 Ct ht ✖ ✖  ✖σ σ σtanh tanh ht
  • 14. Memory Pipeline Xt     0 1 2 3 ht-1 Ct-1 Ct ht ✖ ✖  ✖σ σ σtanh tanh ht
  • 15. Generate the output Xt     0 1 2 3 ht-1 Ct-1 Ct ht ✖ ✖  ✖σ σ σtanh tanh ht
  • 17. Sin wave predictor  Generate sin curve  Load 5000 X 50 sequences  90:10 split on train/test sets
  • 18. Power Consumption Dataset  Power Consumption Dataset  47 Months of data  2075259 measurements  Active energy consumed per min  Load 4567 X 50 sequences  90:10 split on train/test sets
  • 19. References  Understanding LSTM Networks http://colah.github.io/posts/2015-08-Understanding- LSTMs/  General Sequence Learning using Recurrent Neural Networks https://www.youtube.com/watch?v=VINCQghQRuM  Recurrent Neural Networks Part 1: Theory https://www.slideshare.net/gakhov  Facebook Prophet https://github.com/facebookincubator/prophet  Images adapted from Shi Yan https://medium.com/@shiyan/understanding-lstm-and-its- diagrams-37e2f46f1714  Anyone Can Learn To Code https://iamtrask.github.io/2015/11/15/anyone-can-code-lstm/

Editor's Notes

  1. Unlike all hidden layers in a neural network, the output layer units most commonly have as activation function: 1. Linear identity function (for regression problems) 2. Softmax (for classification problems).
  2. If you multiply the old memory C_t-1 with a vector that is close to 0, that means you want to forget most of the old memory. You let the old memory goes through, if your forget valve equals 1. Then the second operation the memory flow will go through is this + operator. New memory and the old memory will merge by this operation. How much new memory should be added to the old memory is controlled by another valve, the ✖ below the + sign.
  3. Sometimes it’s good to forget. If you’re analyzing a text corpus and come to the end of a document you may have no reason to believe that the next document has any relationship to it whatsoever, and therefore the memory cell should be reset before the network gets the first element of the next document. In many cases by reset we don’t only mean immediate set it to 0, but also gradual resets corresponding to slowly fading cell states