Removed redundant tf.exp on predictions in evaluate method
In the `evaluate` method, the usage of `tf.exp` seems redundant here, since `predictions` itself is the logits output of a dense layer in decoder. Therefore, I removed `tf.exp` so that `tf.multinomial` is applied on the logits directly, which agrees better with the proper usage of `tf.multinomial`.
This commit is contained in:
parent
842cd17c10
commit
f0b3a02cb7
@ -753,7 +753,7 @@
|
||||
" attention_weights = tf.reshape(attention_weights, (-1, ))\n",
|
||||
" attention_plot[t] = attention_weights.numpy()\n",
|
||||
"\n",
|
||||
" predicted_id = tf.multinomial(tf.exp(predictions), num_samples=1)[0][0].numpy()\n",
|
||||
" predicted_id = tf.multinomial(predictions, num_samples=1)[0][0].numpy()\n",
|
||||
"\n",
|
||||
" result += targ_lang.idx2word[predicted_id] + ' '\n",
|
||||
"\n",
|
||||
|
Loading…
Reference in New Issue
Block a user