Closed blythed closed 5 years ago
The output of char_lstm is (output_sequence, final_state), see this.
Above code use td.Map(char_lstm >> td.GetItem(1))
to get final_state which is a tuple (new_h, new_c) actually.
td.RNN(word_cell)
need a sequence of new_h, so when it tries to call get_shape on get_h, it calls get_shape on tuple (new_h, new_c).
I think the word_lstm
should be like this:
word_lstm = td.Map(char_lstm >> td.GetItem(1) >> td.GetItem(0)) >> td.RNN(word_cell)
see issue #54 and pr #63
I am attempting the blocks tutorial. Here's my code:
The error is printed in the comment However the td.Map documentation says that it takes tuples as inputs. Any help would be greatly appreciated.