SlideShare a Scribd company logo
1 of 8
RNN ARCHITECTURES
LSTM AND GRU WITH TENSORFLOW BACKEND
LSTM – LONG SHORT TERM MEMORY
Has memory mechanisms allowing better storage of information
than plain RNNs.
Maintains state over time hence are good for modelling time series
data.
 The data used to
investigate LSTM
architecture of RNN.
LSTM model explained
Contains the following: forget gate, candidate layer, input gate,
output gate, hidden state, memory state and outputs from the
LSTM cell.
Previous memory state is used for element wise multiplication with
the forget gate to decide present memory state.
The model used in code contains 60 time-steps and 1 output.
The data is then reshaped for modelling and a model for training is
used for predicting the test data.
 The architecture uses time
series data and overcomes
the vanishing gradient
problem.
 There are 50 epochs in the
architecture.
 A prediction made for the
stock prices against the stock
market price.
GRU – GATED RECURRENT UNIT
 Work using the same principle as LSTM.
 Only that they are streamlined and are thus cheaper to run.
 It is a trade off between computational and representational
power.
 The backend being used
for this application is the
Tensor Flow core library.
GRU Model explained
 Its unique in that it does not use memory units to control flow of data.
 We therefore have fewer parameter to train in this case and therefore
the model takes shorter time.
 They have two gates : the reset and update gate.
 Reset gate determines combination of new input to memory.
 Update gate determines how much of previous state should be kept.
 GRU has the
reset gat and
the update gate.
 Prediction
based on the
GRU model.
REFERENCE LIST
1. Huang, Y., Chen, C. H., & Huang, C. J. (2019). Motor fault detection and
feature extraction using RNN-based variational autoencoder. IEEE
Access, 7, 139086-139096.
2. Zhang, X., Chen, M. H., & Qin, Y. (2018, September). NLP-QA
Framework Based on LSTM-RNN. In 2018 2nd International Conference
on Data Science and Business Analytics (ICDSBA) (pp. 307-311). IEEE.
3. Kim, Y. J., & Chi, M. (2018, January). Temporal Belief Memory:
Imputing Missing Data during RNN Training. In In Proceedings of the
27th International Joint Conference on Artificial Intelligence (IJCAI-
2018).

More Related Content

Similar to RNN ARCHITECTURES: LSTM and GRU WITH TENSORFLOW BACKEND

Algorithm selection for sorting in embedded and mobile systems
Algorithm selection for sorting in embedded and mobile systemsAlgorithm selection for sorting in embedded and mobile systems
Algorithm selection for sorting in embedded and mobile systems
Jigisha Aryya
 

Similar to RNN ARCHITECTURES: LSTM and GRU WITH TENSORFLOW BACKEND (20)

Android Malware
Android Malware Android Malware
Android Malware
 
IRJET- Stock Market Cost Forecasting by Recurrent Neural Network on Long Shor...
IRJET- Stock Market Cost Forecasting by Recurrent Neural Network on Long Shor...IRJET- Stock Market Cost Forecasting by Recurrent Neural Network on Long Shor...
IRJET- Stock Market Cost Forecasting by Recurrent Neural Network on Long Shor...
 
A Hybrid Deep Neural Network Model For Time Series Forecasting
A Hybrid Deep Neural Network Model For Time Series ForecastingA Hybrid Deep Neural Network Model For Time Series Forecasting
A Hybrid Deep Neural Network Model For Time Series Forecasting
 
Final PPT.pptx
Final PPT.pptxFinal PPT.pptx
Final PPT.pptx
 
Fpga based artificial neural network
Fpga based artificial neural networkFpga based artificial neural network
Fpga based artificial neural network
 
STOCK MARKET PREDICTION USING NEURAL NETWORKS
STOCK MARKET PREDICTION USING NEURAL NETWORKSSTOCK MARKET PREDICTION USING NEURAL NETWORKS
STOCK MARKET PREDICTION USING NEURAL NETWORKS
 
Stock Market Prediction using Long Short-Term Memory
Stock Market Prediction using Long Short-Term MemoryStock Market Prediction using Long Short-Term Memory
Stock Market Prediction using Long Short-Term Memory
 
Foundation of Generative AI: Study Materials Connecting the Dots by Delving i...
Foundation of Generative AI: Study Materials Connecting the Dots by Delving i...Foundation of Generative AI: Study Materials Connecting the Dots by Delving i...
Foundation of Generative AI: Study Materials Connecting the Dots by Delving i...
 
stock prise prediction.pptx
stock prise prediction.pptxstock prise prediction.pptx
stock prise prediction.pptx
 
Algorithm selection for sorting in embedded and mobile systems
Algorithm selection for sorting in embedded and mobile systemsAlgorithm selection for sorting in embedded and mobile systems
Algorithm selection for sorting in embedded and mobile systems
 
LSTM based method oh ML.pptx
LSTM based method oh ML.pptxLSTM based method oh ML.pptx
LSTM based method oh ML.pptx
 
STOCK PRICE PREDICTION USING ML TECHNIQUES
STOCK PRICE PREDICTION USING ML TECHNIQUESSTOCK PRICE PREDICTION USING ML TECHNIQUES
STOCK PRICE PREDICTION USING ML TECHNIQUES
 
flowchart ON DEEP LEARNING SPP
flowchart ON DEEP LEARNING SPPflowchart ON DEEP LEARNING SPP
flowchart ON DEEP LEARNING SPP
 
Literature Review
Literature ReviewLiterature Review
Literature Review
 
Hardback solution to accelerate multimedia computation through mgp in cmp
Hardback solution to accelerate multimedia computation through mgp in cmpHardback solution to accelerate multimedia computation through mgp in cmp
Hardback solution to accelerate multimedia computation through mgp in cmp
 
ON THE PERFORMANCE OF INTRUSION DETECTION SYSTEMS WITH HIDDEN MULTILAYER NEUR...
ON THE PERFORMANCE OF INTRUSION DETECTION SYSTEMS WITH HIDDEN MULTILAYER NEUR...ON THE PERFORMANCE OF INTRUSION DETECTION SYSTEMS WITH HIDDEN MULTILAYER NEUR...
ON THE PERFORMANCE OF INTRUSION DETECTION SYSTEMS WITH HIDDEN MULTILAYER NEUR...
 
On The Performance of Intrusion Detection Systems with Hidden Multilayer Neur...
On The Performance of Intrusion Detection Systems with Hidden Multilayer Neur...On The Performance of Intrusion Detection Systems with Hidden Multilayer Neur...
On The Performance of Intrusion Detection Systems with Hidden Multilayer Neur...
 
Energy Consumption in Key Management Operations in WSNs
Energy Consumption in Key Management Operations in WSNsEnergy Consumption in Key Management Operations in WSNs
Energy Consumption in Key Management Operations in WSNs
 
Concepts of Temporal CNN, Recurrent Neural Network, Attention
Concepts of Temporal CNN, Recurrent Neural Network, AttentionConcepts of Temporal CNN, Recurrent Neural Network, Attention
Concepts of Temporal CNN, Recurrent Neural Network, Attention
 
論文輪読資料「Gated Feedback Recurrent Neural Networks」
論文輪読資料「Gated Feedback Recurrent Neural Networks」論文輪読資料「Gated Feedback Recurrent Neural Networks」
論文輪読資料「Gated Feedback Recurrent Neural Networks」
 

More from Peachy Essay

More from Peachy Essay (20)

Internship Experience at Eracew Limited - Ghana
Internship Experience at Eracew Limited - GhanaInternship Experience at Eracew Limited - Ghana
Internship Experience at Eracew Limited - Ghana
 
Kraft Heinz
Kraft HeinzKraft Heinz
Kraft Heinz
 
Healthcare Technology in Nursing
Healthcare Technology in NursingHealthcare Technology in Nursing
Healthcare Technology in Nursing
 
THE PROBLEM OF CHINA’S AGING POPULATION
THE PROBLEM OF CHINA’S AGING POPULATIONTHE PROBLEM OF CHINA’S AGING POPULATION
THE PROBLEM OF CHINA’S AGING POPULATION
 
ILLEGAL IMMIGRATION IN UNITED KINGDOM
ILLEGAL IMMIGRATION IN UNITED KINGDOMILLEGAL IMMIGRATION IN UNITED KINGDOM
ILLEGAL IMMIGRATION IN UNITED KINGDOM
 
Patient/Family Discharge Teaching Plan
Patient/Family Discharge Teaching Plan Patient/Family Discharge Teaching Plan
Patient/Family Discharge Teaching Plan
 
Feminist Criticism Mother Tongue
Feminist Criticism Mother TongueFeminist Criticism Mother Tongue
Feminist Criticism Mother Tongue
 
Explorations in Economic History
Explorations in Economic HistoryExplorations in Economic History
Explorations in Economic History
 
THE OPTIC NERVE
THE OPTIC NERVETHE OPTIC NERVE
THE OPTIC NERVE
 
The Impact of Covid-19-Induced Remote Consultations on Nurse-Patient Relation...
The Impact of Covid-19-Induced Remote Consultations on Nurse-Patient Relation...The Impact of Covid-19-Induced Remote Consultations on Nurse-Patient Relation...
The Impact of Covid-19-Induced Remote Consultations on Nurse-Patient Relation...
 
Negligence Risks Liabilities In Clean Public Business Facility
Negligence Risks Liabilities In Clean Public Business FacilityNegligence Risks Liabilities In Clean Public Business Facility
Negligence Risks Liabilities In Clean Public Business Facility
 
Sustainable and Accessible Resort
Sustainable and Accessible ResortSustainable and Accessible Resort
Sustainable and Accessible Resort
 
International Business Cultural Analysis of Singapore
International Business Cultural Analysis of SingaporeInternational Business Cultural Analysis of Singapore
International Business Cultural Analysis of Singapore
 
Bethesda Mining Company
Bethesda Mining CompanyBethesda Mining Company
Bethesda Mining Company
 
Remote Patient Monitoring System at Mayo Clinic
Remote Patient Monitoring System at Mayo ClinicRemote Patient Monitoring System at Mayo Clinic
Remote Patient Monitoring System at Mayo Clinic
 
Opioid Crisis During Pandemic in BC
Opioid Crisis During Pandemic in BCOpioid Crisis During Pandemic in BC
Opioid Crisis During Pandemic in BC
 
Explanation: Inverted Yield Curve
Explanation: Inverted Yield CurveExplanation: Inverted Yield Curve
Explanation: Inverted Yield Curve
 
Magnet Recognition Program
Magnet Recognition ProgramMagnet Recognition Program
Magnet Recognition Program
 
Empirical Indicators: Johnson’s Behavioral System Model
Empirical Indicators: Johnson’s Behavioral System ModelEmpirical Indicators: Johnson’s Behavioral System Model
Empirical Indicators: Johnson’s Behavioral System Model
 
Patient's Report Timeliness; Nursing Leadership
Patient's Report Timeliness; Nursing LeadershipPatient's Report Timeliness; Nursing Leadership
Patient's Report Timeliness; Nursing Leadership
 

Recently uploaded

notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
MsecMca
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
ssuser89054b
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
mphochane1998
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
MayuraD1
 

Recently uploaded (20)

DC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equationDC MACHINE-Motoring and generation, Armature circuit equation
DC MACHINE-Motoring and generation, Armature circuit equation
 
notes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.pptnotes on Evolution Of Analytic Scalability.ppt
notes on Evolution Of Analytic Scalability.ppt
 
Thermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.pptThermal Engineering -unit - III & IV.ppt
Thermal Engineering -unit - III & IV.ppt
 
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
XXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXXX
 
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments""Lesotho Leaps Forward: A Chronicle of Transformative Developments"
"Lesotho Leaps Forward: A Chronicle of Transformative Developments"
 
Rums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdfRums floating Omkareshwar FSPV IM_16112021.pdf
Rums floating Omkareshwar FSPV IM_16112021.pdf
 
kiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal loadkiln thermal load.pptx kiln tgermal load
kiln thermal load.pptx kiln tgermal load
 
2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects2016EF22_0 solar project report rooftop projects
2016EF22_0 solar project report rooftop projects
 
School management system project Report.pdf
School management system project Report.pdfSchool management system project Report.pdf
School management system project Report.pdf
 
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced LoadsFEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
FEA Based Level 3 Assessment of Deformed Tanks with Fluid Induced Loads
 
Block diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.pptBlock diagram reduction techniques in control systems.ppt
Block diagram reduction techniques in control systems.ppt
 
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
Navigating Complexity: The Role of Trusted Partners and VIAS3D in Dassault Sy...
 
Hostel management system project report..pdf
Hostel management system project report..pdfHostel management system project report..pdf
Hostel management system project report..pdf
 
Work-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptxWork-Permit-Receiver-in-Saudi-Aramco.pptx
Work-Permit-Receiver-in-Saudi-Aramco.pptx
 
Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086Minimum and Maximum Modes of microprocessor 8086
Minimum and Maximum Modes of microprocessor 8086
 
Computer Networks Basics of Network Devices
Computer Networks  Basics of Network DevicesComputer Networks  Basics of Network Devices
Computer Networks Basics of Network Devices
 
Thermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - VThermal Engineering-R & A / C - unit - V
Thermal Engineering-R & A / C - unit - V
 
data_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdfdata_management_and _data_science_cheat_sheet.pdf
data_management_and _data_science_cheat_sheet.pdf
 
DeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakesDeepFakes presentation : brief idea of DeepFakes
DeepFakes presentation : brief idea of DeepFakes
 
A Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna MunicipalityA Study of Urban Area Plan for Pabna Municipality
A Study of Urban Area Plan for Pabna Municipality
 

RNN ARCHITECTURES: LSTM and GRU WITH TENSORFLOW BACKEND

  • 1. RNN ARCHITECTURES LSTM AND GRU WITH TENSORFLOW BACKEND
  • 2. LSTM – LONG SHORT TERM MEMORY Has memory mechanisms allowing better storage of information than plain RNNs. Maintains state over time hence are good for modelling time series data.  The data used to investigate LSTM architecture of RNN.
  • 3. LSTM model explained Contains the following: forget gate, candidate layer, input gate, output gate, hidden state, memory state and outputs from the LSTM cell. Previous memory state is used for element wise multiplication with the forget gate to decide present memory state. The model used in code contains 60 time-steps and 1 output. The data is then reshaped for modelling and a model for training is used for predicting the test data.
  • 4.  The architecture uses time series data and overcomes the vanishing gradient problem.  There are 50 epochs in the architecture.  A prediction made for the stock prices against the stock market price.
  • 5. GRU – GATED RECURRENT UNIT  Work using the same principle as LSTM.  Only that they are streamlined and are thus cheaper to run.  It is a trade off between computational and representational power.  The backend being used for this application is the Tensor Flow core library.
  • 6. GRU Model explained  Its unique in that it does not use memory units to control flow of data.  We therefore have fewer parameter to train in this case and therefore the model takes shorter time.  They have two gates : the reset and update gate.  Reset gate determines combination of new input to memory.  Update gate determines how much of previous state should be kept.
  • 7.  GRU has the reset gat and the update gate.  Prediction based on the GRU model.
  • 8. REFERENCE LIST 1. Huang, Y., Chen, C. H., & Huang, C. J. (2019). Motor fault detection and feature extraction using RNN-based variational autoencoder. IEEE Access, 7, 139086-139096. 2. Zhang, X., Chen, M. H., & Qin, Y. (2018, September). NLP-QA Framework Based on LSTM-RNN. In 2018 2nd International Conference on Data Science and Business Analytics (ICDSBA) (pp. 307-311). IEEE. 3. Kim, Y. J., & Chi, M. (2018, January). Temporal Belief Memory: Imputing Missing Data during RNN Training. In In Proceedings of the 27th International Joint Conference on Artificial Intelligence (IJCAI- 2018).

Editor's Notes

  1. Includes the memory cell and the gates. Contents of the memory cell are modulated by the input gates and forget gates. Gating allows retaining of information over deeper time epochs hence allowing the LSTM model to overcome the vanishing gradient problem. (Kim, & Chi, 2018
  2. Since LSTMs store long term memory state, we create a data structure with 60 time steps and 1 output. So for each element of training set, we have 60 previous training set elements.
  3. Gated recurrent unit (GRU) layers work using the same principle as LSTM, but they’re somewhat streamlined and thus cheaper to run (although they may not have as much representational power as LSTM). This trade-off between computational expensiveness and representational power is seen everywhere in machine learning. (Huang, Chen, & Huang, 2019)
  4. The major difference is that the GRU fully exposes its memory content using only leaky integration (but with an adaptive time constant controlled by the update gate). The GRU was inspired by the LSTM unit but is considered simpler to compute and implement. (Huang, Chen, & Huang, 2019)