
Deep Learning Neural Network With Memory Concepts
Explore the concepts of deep learning neural networks with memory, including recurrent neural networks with ordered input data, training methodologies, and the challenges faced in RNN training. Dive into examples like a simple RNN and understanding bidirectional RNNs.
Download Presentation

Please find below an Image/Link to download the presentation.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author. If you encounter any issues during the download, it is possible that the publisher has removed the file from their server.
You are allowed to download the files provided on this website for personal or commercial use, subject to the condition that they are used lawfully. All files are the property of their respective owners.
The content on the website is provided AS IS for your information and personal use only. It may not be sold, licensed, or shared on other websites without obtaining consent from the author.
E N D
Presentation Transcript
Deep Learning Neural Network with Memory (2) Hung-yi Lee
RNN With order Input data: ?1 ?2 ?3 (xiare vectors) y1 y1=softmax(Woa1) Wo copy a1= (Wix1+Wh0) memory a1 0 Wh Wi x1
RNN With order Input data: ?1 ?2 y2 ?3 (xiare vectors) y1 y2=softmax(Woa2) Wo copy a2= (Wix2+Wha1) memory a1 a2 0 Wh Wi x2
RNN With order Input data: ?1 ?2 y2 ?3 y3 (xiare vectors) y1 y3=softmax(Woa3) Wo copy a3= (Wix3+Wha2) memory a1 a2 a3 0 Wh Wi x3
RNN Input data: ?1 With order ?2 y2 ?3 y3 (xiare vectors) y1 y2 y1 y3 Wo Wo Wo init Wh Wh Wh Wi Wi Wi x3 x2 x1 Output yidepends on xi x2, x1
Training data: ?1 ?1 RNN Training ?2 ?2 ?3 ?3 Training the parameters to let ? close to ? ?1 ?2 Backpropagation Through Time (BPTT) ?3 y2 y1 y3 error Wo Wo Wo init Wh Wh Wh also Wi Wi Wi trainable x3 x2 x1
?3 y3 UNFOLD A deep neural network x3 Input: init, x1, x2, x3 output: y3 target: ?3 x2 x1 init
?3 y3 UNFOLD i Some parameters are shared. Initialize w1, w2by the same value ?1 k i j ?? ??2 ?? ??1 x3 ?1 ?1 ?? ?2 ??1 ?? ??2 k i j x2 ?2 ?2 k j x1 init
Bidirectional RNN xi xi-1 xi+1 yi-1 yi+1 yi xi xi-1 xi+1
Difficulty of RNN Training Unfortunately, it is not easy to train RNN.
Example: A simple RNN 0.7 Cost C50= (y50- 0.7)2 y3 y50 y1 y2 0.5 wr wr wr wr wi wi wi wi 1 1 1 1
red: large C50 purple: small C50 Example: A simple RNN Cost C50= (y50- 0.7)2 wr wi
Example: A simple RNN Clipped gradient Cost C50 wr wi http://jmlr.org/proceedings/papers/v28/pascanu13.pdf
Cost C50 = (y50- 0.7)2 Exploding Gradients ?50=??50 Some parameters are shared. ?1= ?? 49 ??50? ?50 If wris large Gradient explode If wris small RNN would be useless 0.7 ?49= ?50??? ?49 y50 ?1= ?2??? ?1 ?50 ?49 ?1 ?2 0.5 wr wr wr wi wi wi wi 1 1 1 1
Exploding Gradients ?3 y3 ?2= ? ?2 ? : element-wise multiplication ??3 ?1= ? ?1 ? ??2 ?3 ?many times Multiplying ? Wh ?2 Wh ?1 Wh init
Be careful when training RNN Clipping the gradients Advanced gradient descent technology Try LSTM Reference: Pascanu, Razvan, Tomas Mikolov, and Yoshua Bengio. "On the difficulty of training recurrent neural networks." Proceedings of The 30th International Conference on Machine Learning. 2013.
Exploding and Vanishing Gradients ?3 y3 3 Consider ?? (consider the k-th dimension of y3) k ? 3 3 ??? ?? = ?? ? i + ? ? ? Ignore the activation function i j 1? 2 ??? 3 x3 ?? ? + ? ? 2? + ??? i j 3 x2 2 + ??? ?? + ? ? ? ? i j x1 1 init ??
Exploding and Vanishing Gradients ?3 y3 3 Consider ?? (consider the k-th dimension of y3) k ? 3 3 ??? ?? = ?? ? i + ? ? ? Ignore the activation function i j 1? 2 ??? 3 x3 ?? ? + ? ? 2? + ??? i j 3 x2 2 + ??? ?? + ? ? ? ? i j Explode or vanish x1 1 init ??