Closed zhupeiru closed 6 years ago
hi Bo Shao, thanks for your public code. I am a new learner and I have learned much from it. I have one doubt: the output layer of decode. The following is yours in the file 'modelcreator.py':
#Decoder my_decoder = tf.contrib.seq2seq.BasicDecoder( cell, helper, decoder_initial_state,) # Dynamic decoding outputs, final_context_state, _ = tf.contrib.seq2seq.dynamic_decode( my_decoder, output_time_major=self.time_major, swap_memory=True, scope=decoder_scope) sample_id = outputs.sample_id logits = self.output_layer(outputs.rnn_output)
I think the code should be like this:
#Decoder my_decoder = tf.contrib.seq2seq.BasicDecoder( cell, helper, decoder_initial_state, output_layer=projection_layer) # Dynamic decoding outputs, final_context_state, _ = tf.contrib.seq2seq.dynamic_decode( my_decoder, output_time_major=self.time_major, swap_memory=True, scope=decoder_scope) logits = outputs.rnn_output
I am wrong...haha. In the predict, you add output_layer in the BasicDecoder.
hi Bo Shao, thanks for your public code. I am a new learner and I have learned much from it. I have one doubt: the output layer of decode. The following is yours in the file 'modelcreator.py':
I think the code should be like this: