Learn Before
Code
Hidden State Initialization in MXNet RNNs
When defining Recurrent Neural Networks (RNNs) using MXNet's high-level APIs, the hidden state is explicitly initialized by invoking the begin_state method. This method generates a list containing the initial hidden state for each example in the minibatch, structured with a shape of (number of hidden layers, batch size, number of hidden units). For advanced architectures like Long Short-Term Memory (LSTM) networks, this list will also encompass additional cell state information.
0
1
Updated 2026-05-14
Tags
D2L
Dive into Deep Learning @ D2L