Recurrent Neural Network (RNN) Are A Type of
Recurrent Neural Network (RNN) Are A Type of
the output from previous step are fed as input to the current step. In
traditional neural networks, all the inputs and outputs are independent of
each other, but in cases like when it is required to predict the next word of a
sentence, the previous words are required and hence there is a need to
remember the previous words. Thus RNN came into existence, which solved
this issue with the help of a Hidden Layer. The main and most important
feature of RNN is Hidden state, which remembers some information about a
sequence.
RNN have a “memory” which remembers all information about what has
been calculated. It uses the same parameters for each input as it performs
the same task on all the inputs or hidden layers to produce the output. This
reduces the complexity of parameters, unlike other neural networks.
The working of a RNN can be understood with the help of below example:
Example:
Suppose there is a deeper network with one input layer, three hidden layers
and one output layer. Then like other neural networks, each hidden layer will
have its own set of weights and biases, let’s say, for hidden layer 1 the
weights and biases are (w1, b1), (w2, b2) for second hidden layer and (w3,
b3) for third hidden layer. This means that each of these layers are
independent of each other, i.e. they do not memorize the previous outputs.
where:
ht -> current state
ht-1 -> previous state
xt -> input state
Formula for applying Activation function(tanh):
where:
whh -> weight at recurrent neuron
wxh -> weight at input neuron
Formula for calculating output:
Yt -> output
Why -> weight at output layer