Okay, let's break down Deep Recurrent Neural Networks (DRNNs).
What is a Recurrent Neural Network (RNN)?
At its core, an RNN is a type of neural network designed to process sequential data. Unlike feedforward networks, RNNs have connections that loop back on themselves, allowing information from previous steps in the sequence to persist and influence current computations. This internal "memory" is maintained through a hidden state vector that gets updated at each time step.
What makes an RNN "Deep"?
A "Deep" Recurrent Neural Network simply means stacking multiple recurrent layers vertically. Instead of having just one recurrent layer processing the sequence, a DRNN has multiple layers, where the output sequence (typically the hidden states) of one layer serves as the input sequence for the next layer.
- Layer 1: Processes the original input sequence X=(x1,x2,...,xT). It produces a sequence of hidden states H(1)=(h1(1) and potentially an output sequence Y(1)=(y1(1).
- Layer 2: Takes the hidden state sequence from Layer 1, H(1), as its input sequence. It computes its own sequence of hidden states H(2) and outputs Y.
- ...and so on: This continues for L layers, creating a deep architecture in the temporal dimension. The input to layer l at time t is typically the hidden state from layer l−1 at time t.
This stacking allows the network to learn hierarchical temporal features. Lower layers might capture short-term dependencies, while higher layers can potentially model longer-term or more abstract temporal patterns.
Blocks of Parameters and Transformations in a Basic RNN Layer
Let's consider a single, basic RNN layer (like a simple vanilla RNN) operating at a single time step t.
Inputs at Time Step t:
- Current Input Vector (xt): The data point at the current time step.
- Previous Hidden State (ht−1): The output (memory) from the previous time step (t) of the layer. For the very first time step (), this is usually initialized to a zero vector or some learned initial state.
Parameter Blocks (Weights and Biases):
These are the values the network learns during training. For a single RNN layer, there are typically three main weight matrices and two bias vectors:
-
Input-to-Hidden Weights (Wxh or U):
- Shape: (size of hidden state) x (size of input)
- Purpose: These weights determine how the current input xt influences the current hidden state . They transform the input vector into the hidden state's representation space.
Associated Transformations at Time Step t:
The computation within a single RNN layer at time step t involves these transformations:
-
Calculate the pre-activation of the hidden state (zt):
- This combines the influence of the current input and the previous hidden state.
- zt=
In a Deep RNN:
A DRNN with L layers means you perform these calculations L times in sequence for each time step. The input xt is fed into Layer 1. The hidden state h from Layer 1 becomes the input for Layer 2, and so on. Each layer ( to ) has its own independent set of parameters (, , , and potentially , ).
Important Note: While the explanation above uses the "vanilla" RNN structure, the concept of stacking layers (making it "deep") applies equally to more sophisticated RNN architectures like Long Short-Term Memory (LSTM) or Gated Recurrent Unit (GRU) networks. In those cases, the internal "blocks of parameters" and transformations are more complex due to the gating mechanisms, but the principle of stacking layers remains the same.