Create the zero initial hidden state used before processing a vanilla RNN sequence. Return a float64 NumPy array with batch_size rows and hidden_dim columns.
Examples
Input: batch_size = 1, hidden_dim = 2
Output: [[0,0]]
Explanation: Each sample begins with an independent zero hidden vector.
Input: batch_size = 2, hidden_dim = 3
Output: [[0,0,0],[0,0,0]]
Input: batch_size = 4, hidden_dim = 1
Output: [[0],[0],[0],[0]]
Hint 1
Use np.zeros with the requested two-dimensional shape and dtype=np.float64.
Requirements
- Fill every hidden-state value with zero.
- Return a new float64 NumPy array with shape (batch_size, hidden_dim).
Constraints
- batch_size and hidden_dim are positive integers.
All steps in RNN
Accepts: number
Accepts: number
Hidden State
Create the zero initial hidden state used before processing a vanilla RNN sequence. Return a float64 NumPy array with batch_size rows and hidden_dim columns.
Examples
Input: batch_size = 1, hidden_dim = 2
Output: [[0,0]]
Explanation: Each sample begins with an independent zero hidden vector.
Input: batch_size = 2, hidden_dim = 3
Output: [[0,0,0],[0,0,0]]
Input: batch_size = 4, hidden_dim = 1
Output: [[0],[0],[0],[0]]
Hint 1
Use np.zeros with the requested two-dimensional shape and dtype=np.float64.
Requirements
- Fill every hidden-state value with zero.
- Return a new float64 NumPy array with shape (batch_size, hidden_dim).
Constraints
- batch_size and hidden_dim are positive integers.
All steps in RNN
Accepts: number
Accepts: number