SlideShare a Scribd company logo
1 of 19
Min-Seo Kim
Network Science Lab
Dept. of Artificial Intelligence
The Catholic University of Korea
E-mail: kms39273@naver.com
1
Previous work
• A deep learning structure designed for analyzing sequential data.
• O(2) reflects both past and current information using h(1) and x(2).
• U: Input layer to hidden layer.
• W: Hidden layer at time t to hidden layer at time t+1.
• V: Hidden layer to output layer.
Recurrent Neural Networks (RNN)
2
Previous work
• RNNs are models that are flexible in terms of the length of input and output values, allowing for the
construction of RNNs in various structures depending on the form of the input and output.
Recurrent Neural Networks (RNN)
3
Previous work
Recurrent Neural Networks (RNN)
4
Previous work
• As the time steps in a vanilla RNN increase, there arises a problem of long-term dependencies, where
information from earlier time steps is not sufficiently transmitted to later stages.
• If important information for prediction is located at the beginning, it becomes impossible to predict effectively.
• Example 1: "I grew up in France and want to be a plumber who is the best in the world and I speak
fluent French."
Long Short-Term Memory (LSTM)
5
Previous work
Long Short-Term Memory (LSTM)
• The core idea of LSTM is to store the information from previous steps in
a memory cell and pass it forward.
• It determines how much of the past information to forget based on the
current information, multiplies it accordingly, and then adds the current
information to this result to pass it on to the next time step.
6
Baseline
torch.nn.RNN
7
Baseline
torch.nn.LSTM
8
Datasets / Code
Import & gpu setting
• Set gpu to learning RNN, LSTM
9
Datasets / Code
Set params
• Set parameters to fit MNIST dataset
10
Datasets / Code
Get data
• Download MNIST dataset
11
Datasets / Code
Net
• Rnn, LSTM implementation
12
Datasets / Code
Train setting
• Train setting
13
Datasets / Code
Train setting
• Train setting
14
Previous
training
15
Methodology
Softmax Function
Applying Softmax in PyTorch
• Converts k-dimensional input vectors into probabilities for each class
• Sum of the output probabilities equals 1
16
Methodology
Log Softmax
Applying Log Softmax in PyTorch
• Applies log to the softmax result
• Addresses vanishing gradients problem and improves numerical stability
17
Methodology
NLLLoss (Negative Log Likelihood Loss)
Cross Entropy Loss
• Calculates the loss for the log softmax output
• Encourages the model to assign high probabilities to the correct labels
• nn.LogSoftmax + nn.NLLLoss = nn.CrossEntropyLoss
• Directly inputs logits, internally computes softmax and NLLLoss
240219_RNN, LSTM code.pptxdddddddddddddddd

More Related Content

Similar to 240219_RNN, LSTM code.pptxdddddddddddddddd

Complete solution for Recurrent neural network.pptx
Complete solution for Recurrent neural network.pptxComplete solution for Recurrent neural network.pptx
Complete solution for Recurrent neural network.pptxArunKumar674066
 
Recurrent neural networks rnn
Recurrent neural networks   rnnRecurrent neural networks   rnn
Recurrent neural networks rnnKuppusamy P
 
Recurrent Neural Networks RNN - Xavier Giro - UPC TelecomBCN Barcelona 2020
Recurrent Neural Networks RNN - Xavier Giro - UPC TelecomBCN Barcelona 2020Recurrent Neural Networks RNN - Xavier Giro - UPC TelecomBCN Barcelona 2020
Recurrent Neural Networks RNN - Xavier Giro - UPC TelecomBCN Barcelona 2020Universitat Politècnica de Catalunya
 
Deep learning and image analytics using Python by Dr Sanparit
Deep learning and image analytics using Python by Dr SanparitDeep learning and image analytics using Python by Dr Sanparit
Deep learning and image analytics using Python by Dr SanparitBAINIDA
 
Recurrent Neural Networks, LSTM and GRU
Recurrent Neural Networks, LSTM and GRURecurrent Neural Networks, LSTM and GRU
Recurrent Neural Networks, LSTM and GRUananth
 
Lecture 7: Recurrent Neural Networks
Lecture 7: Recurrent Neural NetworksLecture 7: Recurrent Neural Networks
Lecture 7: Recurrent Neural NetworksSang Jun Lee
 
Introduction to deep learning
Introduction to deep learningIntroduction to deep learning
Introduction to deep learningJunaid Bhat
 
Deep learning notes.pptx
Deep learning notes.pptxDeep learning notes.pptx
Deep learning notes.pptxPandi Gingee
 
Convolutional Neural Network and RNN for OCR problem.
Convolutional Neural Network and RNN for OCR problem.Convolutional Neural Network and RNN for OCR problem.
Convolutional Neural Network and RNN for OCR problem.Vishal Mishra
 
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
 
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 DataYao-Chieh Hu
 
A Survey of Convolutional Neural Networks
A Survey of Convolutional Neural NetworksA Survey of Convolutional Neural Networks
A Survey of Convolutional Neural NetworksRimzim Thube
 
Future semantic segmentation with convolutional LSTM
Future semantic segmentation with convolutional LSTMFuture semantic segmentation with convolutional LSTM
Future semantic segmentation with convolutional LSTMKyuri Kim
 
NS-CUK Joint Journal Club: Minwoo Choi, Review on "Spatio-Temporal Wind Speed...
NS-CUK Joint Journal Club: Minwoo Choi, Review on "Spatio-Temporal Wind Speed...NS-CUK Joint Journal Club: Minwoo Choi, Review on "Spatio-Temporal Wind Speed...
NS-CUK Joint Journal Club: Minwoo Choi, Review on "Spatio-Temporal Wind Speed...ssuser4b1f48
 
Anthill Talk Aditya
Anthill Talk AdityaAnthill Talk Aditya
Anthill Talk AdityaAditya Patel
 
Cvpr 2018 papers review (efficient computing)
Cvpr 2018 papers review (efficient computing)Cvpr 2018 papers review (efficient computing)
Cvpr 2018 papers review (efficient computing)DonghyunKang12
 
Startup.Ml: Using neon for NLP and Localization Applications
Startup.Ml: Using neon for NLP and Localization Applications Startup.Ml: Using neon for NLP and Localization Applications
Startup.Ml: Using neon for NLP and Localization Applications Intel Nervana
 
Hardware Acceleration for Machine Learning
Hardware Acceleration for Machine LearningHardware Acceleration for Machine Learning
Hardware Acceleration for Machine LearningCastLabKAIST
 

Similar to 240219_RNN, LSTM code.pptxdddddddddddddddd (20)

Complete solution for Recurrent neural network.pptx
Complete solution for Recurrent neural network.pptxComplete solution for Recurrent neural network.pptx
Complete solution for Recurrent neural network.pptx
 
Recurrent neural networks rnn
Recurrent neural networks   rnnRecurrent neural networks   rnn
Recurrent neural networks rnn
 
Recurrent Neural Networks RNN - Xavier Giro - UPC TelecomBCN Barcelona 2020
Recurrent Neural Networks RNN - Xavier Giro - UPC TelecomBCN Barcelona 2020Recurrent Neural Networks RNN - Xavier Giro - UPC TelecomBCN Barcelona 2020
Recurrent Neural Networks RNN - Xavier Giro - UPC TelecomBCN Barcelona 2020
 
Deep learning and image analytics using Python by Dr Sanparit
Deep learning and image analytics using Python by Dr SanparitDeep learning and image analytics using Python by Dr Sanparit
Deep learning and image analytics using Python by Dr Sanparit
 
Rnn & Lstm
Rnn & LstmRnn & Lstm
Rnn & Lstm
 
Recurrent Neural Networks, LSTM and GRU
Recurrent Neural Networks, LSTM and GRURecurrent Neural Networks, LSTM and GRU
Recurrent Neural Networks, LSTM and GRU
 
Lecture 7: Recurrent Neural Networks
Lecture 7: Recurrent Neural NetworksLecture 7: Recurrent Neural Networks
Lecture 7: Recurrent Neural Networks
 
Introduction to deep learning
Introduction to deep learningIntroduction to deep learning
Introduction to deep learning
 
Deep learning notes.pptx
Deep learning notes.pptxDeep learning notes.pptx
Deep learning notes.pptx
 
Convolutional Neural Network and RNN for OCR problem.
Convolutional Neural Network and RNN for OCR problem.Convolutional Neural Network and RNN for OCR problem.
Convolutional Neural Network and RNN for OCR problem.
 
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)
 
Rnn for seq
Rnn for seqRnn for seq
Rnn for seq
 
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
 
A Survey of Convolutional Neural Networks
A Survey of Convolutional Neural NetworksA Survey of Convolutional Neural Networks
A Survey of Convolutional Neural Networks
 
Future semantic segmentation with convolutional LSTM
Future semantic segmentation with convolutional LSTMFuture semantic segmentation with convolutional LSTM
Future semantic segmentation with convolutional LSTM
 
NS-CUK Joint Journal Club: Minwoo Choi, Review on "Spatio-Temporal Wind Speed...
NS-CUK Joint Journal Club: Minwoo Choi, Review on "Spatio-Temporal Wind Speed...NS-CUK Joint Journal Club: Minwoo Choi, Review on "Spatio-Temporal Wind Speed...
NS-CUK Joint Journal Club: Minwoo Choi, Review on "Spatio-Temporal Wind Speed...
 
Anthill Talk Aditya
Anthill Talk AdityaAnthill Talk Aditya
Anthill Talk Aditya
 
Cvpr 2018 papers review (efficient computing)
Cvpr 2018 papers review (efficient computing)Cvpr 2018 papers review (efficient computing)
Cvpr 2018 papers review (efficient computing)
 
Startup.Ml: Using neon for NLP and Localization Applications
Startup.Ml: Using neon for NLP and Localization Applications Startup.Ml: Using neon for NLP and Localization Applications
Startup.Ml: Using neon for NLP and Localization Applications
 
Hardware Acceleration for Machine Learning
Hardware Acceleration for Machine LearningHardware Acceleration for Machine Learning
Hardware Acceleration for Machine Learning
 

More from ssuser2624f71

Vector and Matrix operationsVector and Matrix operations
Vector and Matrix operationsVector and Matrix operationsVector and Matrix operationsVector and Matrix operations
Vector and Matrix operationsVector and Matrix operationsssuser2624f71
 
Sparse Graph Attention Networks 2021.pptx
Sparse Graph Attention Networks 2021.pptxSparse Graph Attention Networks 2021.pptx
Sparse Graph Attention Networks 2021.pptxssuser2624f71
 
인공지능 로봇 윤리_1229_9차시.pptx
인공지능 로봇 윤리_1229_9차시.pptx인공지능 로봇 윤리_1229_9차시.pptx
인공지능 로봇 윤리_1229_9차시.pptxssuser2624f71
 
인공지능 로봇 윤리_1228_8차시.pptx
인공지능 로봇 윤리_1228_8차시.pptx인공지능 로봇 윤리_1228_8차시.pptx
인공지능 로봇 윤리_1228_8차시.pptxssuser2624f71
 
인공지능 로봇 윤리_1227_7차시.pptx
인공지능 로봇 윤리_1227_7차시.pptx인공지능 로봇 윤리_1227_7차시.pptx
인공지능 로봇 윤리_1227_7차시.pptxssuser2624f71
 
인공지능 로봇 윤리_1226_6차시.pptx
인공지능 로봇 윤리_1226_6차시.pptx인공지능 로봇 윤리_1226_6차시.pptx
인공지능 로봇 윤리_1226_6차시.pptxssuser2624f71
 
인공지능 로봇 윤리_1222_5차시.pptx
인공지능 로봇 윤리_1222_5차시.pptx인공지능 로봇 윤리_1222_5차시.pptx
인공지능 로봇 윤리_1222_5차시.pptxssuser2624f71
 
인공지능 로봇 윤리_1221_4차시.pptx
인공지능 로봇 윤리_1221_4차시.pptx인공지능 로봇 윤리_1221_4차시.pptx
인공지능 로봇 윤리_1221_4차시.pptxssuser2624f71
 
인공지능 로봇 윤리_1220_3차시.pptx
인공지능 로봇 윤리_1220_3차시.pptx인공지능 로봇 윤리_1220_3차시.pptx
인공지능 로봇 윤리_1220_3차시.pptxssuser2624f71
 
인공지능 로봇 윤리_1219_2차시.pptx
인공지능 로봇 윤리_1219_2차시.pptx인공지능 로봇 윤리_1219_2차시.pptx
인공지능 로봇 윤리_1219_2차시.pptxssuser2624f71
 
인공지능 로봇 윤리_1218_1차시.pptx
인공지능 로봇 윤리_1218_1차시.pptx인공지능 로봇 윤리_1218_1차시.pptx
인공지능 로봇 윤리_1218_1차시.pptxssuser2624f71
 
디지털인문학9차시.pptx
디지털인문학9차시.pptx디지털인문학9차시.pptx
디지털인문학9차시.pptxssuser2624f71
 
디지털인문학8차시.pptx
디지털인문학8차시.pptx디지털인문학8차시.pptx
디지털인문학8차시.pptxssuser2624f71
 
디지털인문학7차시.pptx
디지털인문학7차시.pptx디지털인문학7차시.pptx
디지털인문학7차시.pptxssuser2624f71
 
디지털인문학6차시.pptx
디지털인문학6차시.pptx디지털인문학6차시.pptx
디지털인문학6차시.pptxssuser2624f71
 
디지털인문학 5차시.pptx
디지털인문학 5차시.pptx디지털인문학 5차시.pptx
디지털인문학 5차시.pptxssuser2624f71
 
디지털인문학4차시.pptx
디지털인문학4차시.pptx디지털인문학4차시.pptx
디지털인문학4차시.pptxssuser2624f71
 
디지털인문학3차시.pptx
디지털인문학3차시.pptx디지털인문학3차시.pptx
디지털인문학3차시.pptxssuser2624f71
 
디지털인문학2차시.pptx
디지털인문학2차시.pptx디지털인문학2차시.pptx
디지털인문학2차시.pptxssuser2624f71
 
디지털인문학1차시.pptx
디지털인문학1차시.pptx디지털인문학1차시.pptx
디지털인문학1차시.pptxssuser2624f71
 

More from ssuser2624f71 (20)

Vector and Matrix operationsVector and Matrix operations
Vector and Matrix operationsVector and Matrix operationsVector and Matrix operationsVector and Matrix operations
Vector and Matrix operationsVector and Matrix operations
 
Sparse Graph Attention Networks 2021.pptx
Sparse Graph Attention Networks 2021.pptxSparse Graph Attention Networks 2021.pptx
Sparse Graph Attention Networks 2021.pptx
 
인공지능 로봇 윤리_1229_9차시.pptx
인공지능 로봇 윤리_1229_9차시.pptx인공지능 로봇 윤리_1229_9차시.pptx
인공지능 로봇 윤리_1229_9차시.pptx
 
인공지능 로봇 윤리_1228_8차시.pptx
인공지능 로봇 윤리_1228_8차시.pptx인공지능 로봇 윤리_1228_8차시.pptx
인공지능 로봇 윤리_1228_8차시.pptx
 
인공지능 로봇 윤리_1227_7차시.pptx
인공지능 로봇 윤리_1227_7차시.pptx인공지능 로봇 윤리_1227_7차시.pptx
인공지능 로봇 윤리_1227_7차시.pptx
 
인공지능 로봇 윤리_1226_6차시.pptx
인공지능 로봇 윤리_1226_6차시.pptx인공지능 로봇 윤리_1226_6차시.pptx
인공지능 로봇 윤리_1226_6차시.pptx
 
인공지능 로봇 윤리_1222_5차시.pptx
인공지능 로봇 윤리_1222_5차시.pptx인공지능 로봇 윤리_1222_5차시.pptx
인공지능 로봇 윤리_1222_5차시.pptx
 
인공지능 로봇 윤리_1221_4차시.pptx
인공지능 로봇 윤리_1221_4차시.pptx인공지능 로봇 윤리_1221_4차시.pptx
인공지능 로봇 윤리_1221_4차시.pptx
 
인공지능 로봇 윤리_1220_3차시.pptx
인공지능 로봇 윤리_1220_3차시.pptx인공지능 로봇 윤리_1220_3차시.pptx
인공지능 로봇 윤리_1220_3차시.pptx
 
인공지능 로봇 윤리_1219_2차시.pptx
인공지능 로봇 윤리_1219_2차시.pptx인공지능 로봇 윤리_1219_2차시.pptx
인공지능 로봇 윤리_1219_2차시.pptx
 
인공지능 로봇 윤리_1218_1차시.pptx
인공지능 로봇 윤리_1218_1차시.pptx인공지능 로봇 윤리_1218_1차시.pptx
인공지능 로봇 윤리_1218_1차시.pptx
 
디지털인문학9차시.pptx
디지털인문학9차시.pptx디지털인문학9차시.pptx
디지털인문학9차시.pptx
 
디지털인문학8차시.pptx
디지털인문학8차시.pptx디지털인문학8차시.pptx
디지털인문학8차시.pptx
 
디지털인문학7차시.pptx
디지털인문학7차시.pptx디지털인문학7차시.pptx
디지털인문학7차시.pptx
 
디지털인문학6차시.pptx
디지털인문학6차시.pptx디지털인문학6차시.pptx
디지털인문학6차시.pptx
 
디지털인문학 5차시.pptx
디지털인문학 5차시.pptx디지털인문학 5차시.pptx
디지털인문학 5차시.pptx
 
디지털인문학4차시.pptx
디지털인문학4차시.pptx디지털인문학4차시.pptx
디지털인문학4차시.pptx
 
디지털인문학3차시.pptx
디지털인문학3차시.pptx디지털인문학3차시.pptx
디지털인문학3차시.pptx
 
디지털인문학2차시.pptx
디지털인문학2차시.pptx디지털인문학2차시.pptx
디지털인문학2차시.pptx
 
디지털인문학1차시.pptx
디지털인문학1차시.pptx디지털인문학1차시.pptx
디지털인문학1차시.pptx
 

Recently uploaded

Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfMahmoud M. Sallam
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxDr.Ibrahim Hassaan
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️9953056974 Low Rate Call Girls In Saket, Delhi NCR
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTiammrhaywood
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitolTechU
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon AUnboundStockton
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...Marc Dusseiller Dusjagr
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxAvyJaneVismanos
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatYousafMalik24
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxUnboundStockton
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxSayali Powar
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxmanuelaromero2013
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxabhijeetpadhi001
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfSumit Tiwari
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Jisc
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxNirmalaLoungPoorunde1
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...jaredbarbolino94
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersSabitha Banu
 

Recently uploaded (20)

Pharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdfPharmacognosy Flower 3. Compositae 2023.pdf
Pharmacognosy Flower 3. Compositae 2023.pdf
 
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝Model Call Girl in Bikash Puri  Delhi reach out to us at 🔝9953056974🔝
Model Call Girl in Bikash Puri Delhi reach out to us at 🔝9953056974🔝
 
Gas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptxGas measurement O2,Co2,& ph) 04/2024.pptx
Gas measurement O2,Co2,& ph) 04/2024.pptx
 
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
call girls in Kamla Market (DELHI) 🔝 >༒9953330565🔝 genuine Escort Service 🔝✔️✔️
 
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPTECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
ECONOMIC CONTEXT - LONG FORM TV DRAMA - PPT
 
Capitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptxCapitol Tech U Doctoral Presentation - April 2024.pptx
Capitol Tech U Doctoral Presentation - April 2024.pptx
 
Crayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon ACrayon Activity Handout For the Crayon A
Crayon Activity Handout For the Crayon A
 
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
“Oh GOSH! Reflecting on Hackteria's Collaborative Practices in a Global Do-It...
 
Final demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptxFinal demo Grade 9 for demo Plan dessert.pptx
Final demo Grade 9 for demo Plan dessert.pptx
 
Earth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice greatEarth Day Presentation wow hello nice great
Earth Day Presentation wow hello nice great
 
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdfTataKelola dan KamSiber Kecerdasan Buatan v022.pdf
TataKelola dan KamSiber Kecerdasan Buatan v022.pdf
 
Blooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docxBlooming Together_ Growing a Community Garden Worksheet.docx
Blooming Together_ Growing a Community Garden Worksheet.docx
 
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptxPOINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
POINT- BIOCHEMISTRY SEM 2 ENZYMES UNIT 5.pptx
 
How to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptxHow to Make a Pirate ship Primary Education.pptx
How to Make a Pirate ship Primary Education.pptx
 
MICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptxMICROBIOLOGY biochemical test detailed.pptx
MICROBIOLOGY biochemical test detailed.pptx
 
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdfEnzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
Enzyme, Pharmaceutical Aids, Miscellaneous Last Part of Chapter no 5th.pdf
 
Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...Procuring digital preservation CAN be quick and painless with our new dynamic...
Procuring digital preservation CAN be quick and painless with our new dynamic...
 
Employee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptxEmployee wellbeing at the workplace.pptx
Employee wellbeing at the workplace.pptx
 
Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...Historical philosophical, theoretical, and legal foundations of special and i...
Historical philosophical, theoretical, and legal foundations of special and i...
 
DATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginnersDATA STRUCTURE AND ALGORITHM for beginners
DATA STRUCTURE AND ALGORITHM for beginners
 

240219_RNN, LSTM code.pptxdddddddddddddddd

  • 1. Min-Seo Kim Network Science Lab Dept. of Artificial Intelligence The Catholic University of Korea E-mail: kms39273@naver.com
  • 2. 1 Previous work • A deep learning structure designed for analyzing sequential data. • O(2) reflects both past and current information using h(1) and x(2). • U: Input layer to hidden layer. • W: Hidden layer at time t to hidden layer at time t+1. • V: Hidden layer to output layer. Recurrent Neural Networks (RNN)
  • 3. 2 Previous work • RNNs are models that are flexible in terms of the length of input and output values, allowing for the construction of RNNs in various structures depending on the form of the input and output. Recurrent Neural Networks (RNN)
  • 5. 4 Previous work • As the time steps in a vanilla RNN increase, there arises a problem of long-term dependencies, where information from earlier time steps is not sufficiently transmitted to later stages. • If important information for prediction is located at the beginning, it becomes impossible to predict effectively. • Example 1: "I grew up in France and want to be a plumber who is the best in the world and I speak fluent French." Long Short-Term Memory (LSTM)
  • 6. 5 Previous work Long Short-Term Memory (LSTM) • The core idea of LSTM is to store the information from previous steps in a memory cell and pass it forward. • It determines how much of the past information to forget based on the current information, multiplies it accordingly, and then adds the current information to this result to pass it on to the next time step.
  • 9. 8 Datasets / Code Import & gpu setting • Set gpu to learning RNN, LSTM
  • 10. 9 Datasets / Code Set params • Set parameters to fit MNIST dataset
  • 11. 10 Datasets / Code Get data • Download MNIST dataset
  • 12. 11 Datasets / Code Net • Rnn, LSTM implementation
  • 13. 12 Datasets / Code Train setting • Train setting
  • 14. 13 Datasets / Code Train setting • Train setting
  • 16. 15 Methodology Softmax Function Applying Softmax in PyTorch • Converts k-dimensional input vectors into probabilities for each class • Sum of the output probabilities equals 1
  • 17. 16 Methodology Log Softmax Applying Log Softmax in PyTorch • Applies log to the softmax result • Addresses vanishing gradients problem and improves numerical stability
  • 18. 17 Methodology NLLLoss (Negative Log Likelihood Loss) Cross Entropy Loss • Calculates the loss for the log softmax output • Encourages the model to assign high probabilities to the correct labels • nn.LogSoftmax + nn.NLLLoss = nn.CrossEntropyLoss • Directly inputs logits, internally computes softmax and NLLLoss

Editor's Notes

  1. 순차적 데이터를 분석하기 위한 딥러닝 구조 O(2)는 h(1)과 x(2)를 이용하여 과거 정보와 현재 정보 모두를 반영 U : 입력층 → 은닉층 W: t 시점 은닉층 → t+1 시점 은닉층 V : 은닉층 → 출력층
  2. RNN은 입력과 출력 값의 길이에 자유로운 모형이기 때문에 Input과 Output의 형태에 따라 다양한 구조로 RNN을 구성할 수 있음.
  3. 바닐라 RNN의 시점(time step)이 길어질 수록 앞의 정보가 뒤로 충분히 전달되지 못하는 장기의존성 문제(the problems of long-term dependencies)의 발생 예측을 위한 중요한 정보가 앞에 있을경우 예측 불가능
  4. LSTM의 핵심 아이디어는 이전 단계의 정보를 memory cell에 저장하여 흘려보내는 것 현재 시점의 정보를 바탕으로 과거의 내용을 얼마나 잊을지 곱해주고, 그 결과에 현재의 정보를 더해서 다음 시점으로 정보를 전달