Skip to content

Commit dc1f9ca

Browse files
authored
Fix comments on input data handling
The comments around input data handling were not consistent with the series of transpose, reshape, and split operation.
1 parent 2969ed0 commit dc1f9ca

1 file changed

Lines changed: 4 additions & 4 deletions

File tree

07_lstm.py

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -32,11 +32,11 @@ def init_weights(shape):
3232

3333

3434
def model(X, W, B, lstm_size):
35-
# X, input shape: (batch_size, input_vec_size, time_step_size)
35+
# X, input shape: (batch_size, time_step_size, input_vec_size)
3636
XT = tf.transpose(X, [1, 0, 2]) # permute time_step_size and batch_size
37-
# XT shape: (input_vec_size, batch_szie, time_step_size)
38-
XR = tf.reshape(XT, [-1, lstm_size]) # each row has input for each lstm cell (lstm_size)
39-
# XR shape: (input vec_size, batch_size)
37+
# XT shape: (time_step_size, batch_size, input_vec_size)
38+
XR = tf.reshape(XT, [-1, lstm_size]) # each row has input for each lstm cell (lstm_size=input_vec_size)
39+
# XR shape: (time_step_size * batch_size, input_vec_size)
4040
X_split = tf.split(0, time_step_size, XR) # split them to time_step_size (28 arrays)
4141
# Each array shape: (batch_size, input_vec_size)
4242

0 commit comments

Comments
 (0)