RNN classification question
jhagege opened this issue · 1 comments
jhagege commented
Hi, first of all, great book !
Quick question: in chapter 5:
with tf.name_scope('linear_layer_weights') as scope:
# Iterate across time, apply linear layer to all RNN outputs
all_outputs = tf.map_fn(get_linear_layer, all_hidden_states)
# Get last output
output = all_outputs[-1]
Why do we calculate "all_outputs", since we are interested only by the last one ?
I'm not worried about optimization, just trying to make sure I understand well the process.
Thanks !
Hezi-Resheff commented
Hello! Thanks for your comment on the book.
I believe we did this to demonstrate the more general case. As you mentioned, optimization is another matter altogether.
Best,
Hezi