July 2019
Intermediate to advanced
512 pages
19h 39m
English
Now we will perform forward propagation and predict the output,
, and initialize a list called y_hat for storing the output:
y_hat = []
For each iteration, we compute the output and store it in the y_hat list:
for i in range(batch_size):
We initialize the hidden state and cell state:
hidden_state = np.zeros([1, hidden_layer], dtype=np.float32) cell_state = np.zeros([1, hidden_layer], dtype=np.float32)
We perform the forward propagation and compute the hidden state and cell state of the LSTM cell for each time step:
for t in range(window_size): cell_state, hidden_state = LSTM_cell(tf.reshape(input[i][t], (-1, ...
Read now
Unlock full access