pbhatia243/Neural_Conversation_Models

projection out-of-use under beam search

owengbs opened this issue · 2 comments

    if beam_search:
          self.outputs, self.beam_path, self.beam_symbol = decode_model_with_buckets(
              self.encoder_inputs, self.decoder_inputs, targets,
              self.target_weights, buckets, lambda x, y: seq2seq_f(x, y, True),
              softmax_loss_function=softmax_loss_function)
    else:
          # print self.decoder_inputs
          self.outputs, self.losses = model_with_buckets(
              self.encoder_inputs, self.decoder_inputs, targets,
              self.target_weights, buckets, lambda x, y: seq2seq_f(x, y, True),
              softmax_loss_function=softmax_loss_function)
          # If we use output projection, we need to project outputs for decoding.
          if output_projection is not None:
                for b in xrange(len(buckets)):
                  self.outputs[b] = [
                      tf.matmul(output, output_projection[0]) + output_projection[1]
                      for output in self.outputs[b]
                  ]

Could you elaborate on the issue ?

Updated with latest version