pointer-network-tensorflow icon indicating copy to clipboard operation
pointer-network-tensorflow copied to clipboard

question about model.py

Open Doubaibai opened this issue 7 years ago • 2 comments

Hi,

I am reading the pointer-network codes. However, I have a question in model.py file. In model.py, line 133-134, you gathered enc_output into dec_inputs. But in the original paper, it seems that the decoder inputs should be from enc_inputs.

133 self.embeded_dec_inputs = tf.stop_gradient( 134 tf.gather_nd(self.enc_outputs, self.idx_pairs))

Could you explain this a little bit?

Best, Zhe

Doubaibai avatar Apr 04 '17 17:04 Doubaibai

Thanks! I've never seen that but you're right. I made a mistake on that and the model should be trained with the ground truth input but the current code does not.

carpedm20 avatar Apr 05 '17 02:04 carpedm20

Yes. That is what I think. I use the enc_input to train and it seems that the model converged faster. But it is interesting that using enc_output the model also works well.

Doubaibai avatar Apr 05 '17 13:04 Doubaibai