How does an RNN process a sequence?
Reveal the answer and explore the explanation.
01EasyCoreHow does an RNN process a sequence?
Answer
EasyCore
How does an RNN process a sequence?
Answer
Processes sequence steps using a recurrent hidden state.
Practical example
Summarize a stream of measurements one time step at a time.
PythonRelated concept example
import torch
from torch import nn
x = torch.randn(2, 5, 8)
model = nn.LSTM(8, 16, batch_first=True)
y, (h, c) = model(x)
print(y.shape)Batch size two, five time steps, 16 output features.
Reference: Further reading ↗