Machine Learning Basics
Which of the following correctly describes recurrent neural networks (RNNs) and LSTMs?
- AAn RNN applies the same filter at every position of an image to extract local features, and an LSTM improves its pooling layer to make it robust to shifts in position
- BAn RNN treats all elements of a sequence independently and processes them simultaneously in parallel without using results from earlier time steps, so longer sequences train faster
- CAn RNN processes a sequence in order, carrying the hidden state from one time step to the next, and an LSTM uses gates to control whether information is kept or forgotten, making vanishing gradients less likely on long sequences
Show answer and explanation
Answer: C. An RNN processes a sequence in order, carrying the hidden state from one time step to the next, and an LSTM uses gates to control whether information is kept or forgotten, making vanishing gradients less likely on long sequences
An RNN processes sequence data such as text, audio or sensor time series one element at a time, passing the information so far to the next time step as a hidden state. Because errors are propagated back through time, gradients readily vanish or explode on long sequences, making it hard to learn information from the distant past. An LSTM has a cell that stores information and input, forget and output gates, so it can keep needed information for a long time. However, both must compute in time order and are hard to parallelize, and the Transformer improved on this point.
- A. This describes a convolutional neural network (CNN).
- B. An RNN uses the result of the previous time step, so it must compute in time order and is hard to parallelize along the sequence.
- C. Correct. It processes the sequence by carrying the hidden state forward, and the LSTM's gates make long-range dependencies easier to handle.