Skip to content

Beam Search 7.Implement Beam Search on Python side

Higepon Taro Minowa edited this page Jun 28, 2017 · 7 revisions

Implement Beam Search in graphs looks a bit hard for me to debug. Here I explore if it's easier to implement on python land.

things to figure out

  • Can we easily access to decoder input?
    • Yes, step method has decoder_inputs, we can also access self.decoder_inputs
  • What is encoder_input in the implementation
    • It's tweet token_ids.
  • What is decoder_input in the implementation
    • It's reply token_ids, but isn't it decoder_output??
    • I was right it's actually decoder_output
  • pseudo code of the seq2seq is
    • c = encoder(encoder_input)
    • output = decoder(c)
  • So we don't have direct access to c
  • We can access some of information using loop_function
    • loop_function get previous output and can override next input as return
Clone this wiki locally