Docsity

GRU & LSTM Complete Notes | Deep Learning, Slides of Artificial Intelligence

Partial preview of the text

Download GRU & LSTM Complete Notes | Deep Learning and more Slides Artificial Intelligence in PDF only on Docsity!

GRU and LSTM

Problems with

RNN

Exploding and vanishing gradient problems

during backpropagation.

Gradients are those values which to update neural

networks weights. In other words, we can say that

Gradient carries information.

Vanishing gradient is a big problem in deep neural

networks. it vanishes or explodes quickly in earlier

layers and this makes RNN unable to hold information

of longer sequence. and thus RNN becomes short-term

memory.

If we apply RNN for a paragraph RNN may leave out

necessary information due to gradient problems and

not be able to carry information from the initial time

LSTM Networks

  • Every LSTM network basically contains three gates to

control the fl ow of information and cells to hold

information. The Cell States carries the information

from initial to later time steps without getting

vanished.

LSTM Networks

Forget Gate:

This gate decides what information should

be carried out forward or what information

should be ignored.

Information from previous hidden states

and the current state information passes

through the sigmoid function. Values that

come out from sigmoid are always

between 0 and 1.

if the value is closer to 1 means information

should proceed forward and if value closer to

0 means information should be ignored.

LSTM Networks

  • Output Gate: - After the information is passed through

the input gate, now the output gate

comes into play.

  • Output gate generates the next hidden

states. and cell states are carried over

the next time step.

GRU

  • (^) GRU ( Gated Recurrent Units ) are similar to the

LSTM networks. GRU is a kind of newer version

of RNN. However, there are some differences

between GRU and LSTM.

GRU doesn’t contain a cell state

GRU uses its hidden states to transport

information

It Contains only 2 gates(Reset and Update

Gate)

GRU is faster than LSTM

GRU has lesser tensor’s operation that

makes it faster

GRU

    1. Update Gate
      • (^) Update Gate is a combination of Forget

Gate and Input Gate. Forget gate decides

what information to ignore and what

information to add in memory.

  1. Reset Gate
    • (^) This Gate Resets the past information in

order to get rid of gradient explosion.

Reset Gate determines how much past

information should be forgotten.

Examples:

  • Practic

al