transformer icon indicating copy to clipboard operation
transformer copied to clipboard

When terminate a inference, the dimensions doesn't match.

Open ty5491003 opened this issue 5 years ago • 2 comments

https://github.com/Kyubyong/transformer/blob/2234b4268355ccc073d8f0535fdd395289001151/model.py#L168

I know this line is used to end a inference, but y_hat.shape=[N, ?], and tf.reduce_sum(y_hat, 1) get a shape=[N], how to compare with self.token2idx["<pad>"](a int value)?

ty5491003 avatar Mar 18 '19 12:03 ty5491003

Please tell me if i'm wrong. @Kyubyong

ty5491003 avatar Mar 18 '19 13:03 ty5491003

@Kyubyong I just ran two experiments, experiment 1 comments this line and the other one doesn't, and i find two results are equal completely. So, i think this code is not be used. Please check it.

ty5491003 avatar Mar 23 '19 08:03 ty5491003