{"id":3487,"date":"2020-05-22T06:32:22","date_gmt":"2020-05-22T06:32:22","guid":{"rendered":"https:\/\/www.aiproblog.com\/index.php\/2020\/05\/22\/what-are-recurrent-neural-networks-and-how-it-is-different-than-convolutional-neural-networks\/"},"modified":"2020-05-22T06:32:22","modified_gmt":"2020-05-22T06:32:22","slug":"what-are-recurrent-neural-networks-and-how-it-is-different-than-convolutional-neural-networks","status":"publish","type":"post","link":"https:\/\/www.aiproblog.com\/index.php\/2020\/05\/22\/what-are-recurrent-neural-networks-and-how-it-is-different-than-convolutional-neural-networks\/","title":{"rendered":"What are \u201cRecurrent Neural Networks\u201d, and how it is different than \u201cConvolutional Neural Networks\u201d"},"content":{"rendered":"<p>Author: Sameer Nigam<\/p>\n<div>\n<p>CNN and RNN are amongst most important algorithm of Neural Network family, also they differ in their network process and solving problems.<\/p>\n<\/p>\n<p>So talking about their differences:<\/p>\n<\/p>\n<p><span style=\"font-weight: 400;\"><strong>CNN<\/strong> are used to solve <strong>classification and regression problems<\/strong> and <strong>RNN<\/strong> are used to <strong>solve sequence information<\/strong>.<\/span><\/p>\n<\/p>\n<p><span style=\"font-weight: 400;\">CNN are used for 2D image data, RNN are used for sequenced data(example time stamped sales data, sequence of text, heart beat data, etc).<\/span><\/p>\n<\/p>\n<p><span style=\"font-weight: 400;\">So does &#8220;Sequences&#8221; means ?<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Example of Sequences:<\/span><\/p>\n<\/p>\n<p><span style=\"font-weight: 400;\">1) Time Series Data<\/span><\/p>\n<p><span style=\"font-weight: 400;\">2) Sentences<\/span><\/p>\n<p><span style=\"font-weight: 400;\">3) Audio<\/span><\/p>\n<p><span style=\"font-weight: 400;\">4) Car Trajectories<\/span><\/p>\n<p><span style=\"font-weight: 400;\">5) Music<\/span><\/p>\n<\/p>\n<p><span style=\"font-weight: 400;\">A human would easily predict the future of sequence [1,2,3,4,5,6], and the most obvious answer here is 7. Same thing we do with Recurrent neural network. Predicting the future by <strong>building a neural network that can learn from the history.<\/strong><\/span><\/p>\n<\/p>\n<p><span style=\"font-weight: 400;\">So to do this we <strong>tell neuron about the previous history of output<\/strong> that came out of the neural network and to do that we simply <strong>feed the output back again as an input.<\/strong><\/span><\/p>\n<\/p>\n<p><span style=\"font-weight: 400;\">Take the image as a visual explanation<\/span><\/p>\n<p><span style=\"font-weight: 400;\">A simple neural network looks like this:<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><a href=\"https:\/\/storage.ning.com\/topology\/rest\/1.0\/file\/get\/4282068728?profile=original\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/storage.ning.com\/topology\/rest\/1.0\/file\/get\/4282068728?profile=RESIZE_710x\" class=\"align-full\"><\/a><\/span><\/p>\n<p><span style=\"font-weight: 400;\">But a Recurrent neural network works like this<\/span><\/p>\n<\/p>\n<p><a href=\"https:\/\/storage.ning.com\/topology\/rest\/1.0\/file\/get\/4282057800?profile=original\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/storage.ning.com\/topology\/rest\/1.0\/file\/get\/4282057800?profile=RESIZE_710x\" class=\"align-full\"><\/a><\/p>\n<p>So a full Recurrent neural network works like this.<\/p>\n<p><a href=\"https:\/\/storage.ning.com\/topology\/rest\/1.0\/file\/get\/4281958219?profile=original\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/storage.ning.com\/topology\/rest\/1.0\/file\/get\/4281958219?profile=RESIZE_710x\" class=\"align-full\"><\/a><\/p>\n<p><span style=\"font-weight: 400;\">&nbsp;Cells that are function of inputs from previous time steps are also known as memory cells.<\/span><\/p>\n<\/p>\n<p><span style=\"font-weight: 400;\">&nbsp;RNN are also flexible in their inputs and outputs, for both sequences and single vector values.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">Artificial Neural Network with three neurons.<\/span><\/p>\n<p><a href=\"https:\/\/storage.ning.com\/topology\/rest\/1.0\/file\/get\/4282086356?profile=original\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/storage.ning.com\/topology\/rest\/1.0\/file\/get\/4282086356?profile=RESIZE_710x\" class=\"align-full\"><\/a><\/p>\n<p><span style=\"font-weight: 400;\">Recurrent Neural Network with three neurons<\/span><\/p>\n<p><span style=\"font-weight: 400;\"><a href=\"https:\/\/storage.ning.com\/topology\/rest\/1.0\/file\/get\/4282156644?profile=original\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/storage.ning.com\/topology\/rest\/1.0\/file\/get\/4282156644?profile=RESIZE_710x\" class=\"align-full\"><\/a><\/span><\/p>\n<p><a href=\"https:\/\/storage.ning.com\/topology\/rest\/1.0\/file\/get\/4282165246?profile=original\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/storage.ning.com\/topology\/rest\/1.0\/file\/get\/4282165246?profile=RESIZE_710x\" class=\"align-full\"><\/a><\/p>\n<\/p>\n<p><span style=\"font-weight: 400;\">How RNN are flexible in their inputs and outputs?<\/span><\/p>\n<\/p>\n<p><a href=\"https:\/\/storage.ning.com\/topology\/rest\/1.0\/file\/get\/4282210716?profile=original\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/storage.ning.com\/topology\/rest\/1.0\/file\/get\/4282210716?profile=RESIZE_710x\" class=\"align-full\"><\/a><\/p>\n<p><a href=\"https:\/\/storage.ning.com\/topology\/rest\/1.0\/file\/get\/4282266925?profile=original\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/storage.ning.com\/topology\/rest\/1.0\/file\/get\/4282266925?profile=RESIZE_710x\" class=\"align-full\"><\/a><\/p>\n<p><a href=\"https:\/\/storage.ning.com\/topology\/rest\/1.0\/file\/get\/4282270008?profile=original\" target=\"_blank\" rel=\"noopener noreferrer\"><img decoding=\"async\" src=\"https:\/\/storage.ning.com\/topology\/rest\/1.0\/file\/get\/4282270008?profile=RESIZE_710x\" class=\"align-full\"><\/a><\/p>\n<p><\/p>\n<p><span style=\"font-weight: 400;\">Major Disadvantage of RNN<\/span><\/p>\n<\/p>\n<p><span style=\"font-weight: 400;\">1) We only remember the previous output, it would be great if we can track the longer history.<\/span><\/p>\n<p><span style=\"font-weight: 400;\">2) Another major issue is &#8220;Vanishing Gradient&#8221;.<\/span><\/p>\n<\/p>\n<p>Which I will be talking about in my next blog.<\/p>\n<p>Comment below what you think.<\/p>\n<\/p>\n<\/div>\n<p><a href=\"https:\/\/www.datasciencecentral.com\/xn\/detail\/6448529:BlogPost:941583\">Go to Source<\/a><\/p>\n","protected":false},"excerpt":{"rendered":"<p>Author: Sameer Nigam CNN and RNN are amongst most important algorithm of Neural Network family, also they differ in their network process and solving problems. [&hellip;] <span class=\"read-more-link\"><a class=\"read-more\" href=\"https:\/\/www.aiproblog.com\/index.php\/2020\/05\/22\/what-are-recurrent-neural-networks-and-how-it-is-different-than-convolutional-neural-networks\/\">Read More<\/a><\/span><\/p>\n","protected":false},"author":1,"featured_media":465,"comment_status":"open","ping_status":"closed","sticky":false,"template":"","format":"standard","meta":{"_bbp_topic_count":0,"_bbp_reply_count":0,"_bbp_total_topic_count":0,"_bbp_total_reply_count":0,"_bbp_voice_count":0,"_bbp_anonymous_reply_count":0,"_bbp_topic_count_hidden":0,"_bbp_reply_count_hidden":0,"_bbp_forum_subforum_count":0,"footnotes":""},"categories":[26],"tags":[],"_links":{"self":[{"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/posts\/3487"}],"collection":[{"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/posts"}],"about":[{"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/types\/post"}],"author":[{"embeddable":true,"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/comments?post=3487"}],"version-history":[{"count":0,"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/posts\/3487\/revisions"}],"wp:featuredmedia":[{"embeddable":true,"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/media\/458"}],"wp:attachment":[{"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/media?parent=3487"}],"wp:term":[{"taxonomy":"category","embeddable":true,"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/categories?post=3487"},{"taxonomy":"post_tag","embeddable":true,"href":"https:\/\/www.aiproblog.com\/index.php\/wp-json\/wp\/v2\/tags?post=3487"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}