Remove unnecessary tf.exp

This commit is contained in:
Ruizhi 2018-08-14 10:07:53 +08:00 committed by GitHub
parent f0b3a02cb7
commit 33c1014549
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

View File

@ -621,7 +621,7 @@
"\n",
" # using a multinomial distribution to predict the word returned by the model\n",
" predictions = predictions / temperature\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",
" # We pass the predicted word as the next input to the model\n",
" # along with the previous hidden state\n",