Skip to content

Commit

Permalink
Merge pull request #12 from DingkunLiu/patch-1
Browse files Browse the repository at this point in the history
Update q2_rnn.py
  • Loading branch information
hankcs committed Jun 23, 2018
2 parents 831d273 + be2e243 commit 873e82c
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions assignment3/q2_rnn.py
Expand Up @@ -296,9 +296,9 @@ def add_prediction_op(self):
### YOUR CODE HERE (~6-10 lines)
if time_step>0:
tf.get_variable_scope().reuse_variables()
_, state = cell( x[:,time_step, :], state, scope="RNN" )
state_dropout = tf.nn.dropout(state, dropout_rate)
output = tf.matmul(state_dropout,U) + b2
o, state = cell( x[:,time_step, :], state, scope="RNN" )
o_drop = tf.nn.dropout(o, dropout_rate)
output = tf.matmul(o_drop,U) + b2
preds.append(output)
### END YOUR CODE

Expand Down

0 comments on commit 873e82c

Please sign in to comment.