Bidirectional RNN
Reads the sequence forwards and backwards so each step sees both past and future.
The idea
Two RNNs run over the same input, one left-to-right and one right-to-left. At each position their hidden states are joined, so the representation of a word reflects the words before and after it. That helps tasks where the whole sentence is known in advance.
Watch it run
This is a real computation, not a drawing. Pause, step, change the settings, or try new random data.
- positive
- negative
- gate (taller = more open)
A bidirectional RNN reads the sequence forwards and also backwards, so each position sees both sides. The first input (1.5) is the thing worth remembering.
- step:
- 0
One memory unit unrolled across seven time steps. Try a bigger first input and compare the cells.
Step by step
- 1Run a forward RNN over the sequence.
- 2Run a backward RNN over the reversed sequence.
- 3At each position concatenate the two hidden states.
- 4Use the joined state for the prediction.
Where it is used
Tagging, named entity recognition, speech recognition.
Watch out for
Cannot be used for live generation, because the future is not available.