Skip to content

Commit 683d39e

Browse files
author
Mofan Zhou
committed
tf RNN2
1 parent 30c09f7 commit 683d39e

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

tensorflowTUT/tf20_RNN2/full_code.py

+2-2
Original file line numberDiff line numberDiff line change
@@ -75,11 +75,11 @@ def RNN(X, weights, biases):
7575
# In here, we go for option 2.
7676
# dynamic_rnn receive Tensor (batch, steps, inputs) or (steps, batch, inputs) as X_in.
7777
# Make sure the time_major is changed accordingly.
78-
outputs, states = tf.nn.dynamic_rnn(lstm_cell, X_in, initial_state=_init_state, time_major=False)
78+
outputs, final_state = tf.nn.dynamic_rnn(lstm_cell, X_in, initial_state=_init_state, time_major=False)
7979

8080
# hidden layer for output as the final results
8181
#############################################
82-
results = tf.matmul(states[1], weights['out']) + biases['out']
82+
results = tf.matmul(final_state[1], weights['out']) + biases['out']
8383

8484
# # or
8585
# # unpack to list [(batch, outputs)..] * steps

0 commit comments

Comments
 (0)