Yayun Liu's Blog Engineer, Blogger, Learner, Runner

Natural Language Processing 0.1.0: Recurrent Neural Networks (RNN)

1 minutes to read
2024-08-01

Recurrent Neural Networks (RNN)

A typical neural network is a feedforward network which takes in a single large vector and processes in one go. In contrast, a recurrent neural network (RRN) processes sequences by iterating through the sequence elements one at a time and maintaining a state containing information relative to what it has seen so far.

An RNN is a type of neural network that has an internal loop depicted in the following figure:

rnn

A lot of time the RRN is illustrated with a sequence of unrolled blocks. The last output at time t-1 is fed into the block of time t.

unrolled-rnn

Why not use a standard NN to for the sequence processing? The problems could be:

  1. The inputs, outputs can be different lengths in different examples.
  2. The standard NN does not share features learned across different positions of text.

Forward Propagation of an RNN

fp

References

  • Deep Learning with Python by Francois Chollet, Chapter 6

Comments

Content