Open yqtaowhu opened 7 years ago
outputs.beam_search_decoder_output is a tuple of three things namely ( scores , predicted_ids , parent_ids )
53 must be time_axis of decoder 10 is the number of sentence 2 is the beam_width
change : logits = outputs.beam_search_decoder_output.scores
@piyank22 thank you very much!
@piyank22 Thanks for you explanation! I just have a follow up question, is there a way that we can find out best prediction amount all results?
in the repo, it seem set beam_id to be 0 as default. I can't find explanation anywhere in the documentation.
beam_id : 0 , implies that no beam search is being used , greedy inference helper is being used.
when i set beam_width =2,and in
moder.py
i changeif beam_width > 0: logits = outputs.beam_search_decder_output sample_id = outputs.predicted_id
this but i get the logits shape is [3,53,10,2] when i decoder 10 sentence i dont know why the first dim is 3 not vocabulary_size. when i set beam_width=0 the logit shape is [50,10,17191] is can easy understand hope can reply!