pbhatia243 / Neural_Conversation_Models

Tensorflow based Neural Conversation Models
Apache License 2.0
191 stars 73 forks source link

projection out-of-use under beam search #3

Closed owengbs closed 7 years ago

owengbs commented 8 years ago
    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]
                  ]
pbhatia243 commented 8 years ago

Could you elaborate on the issue ?

pbhatia243 commented 7 years ago

Updated with latest version