-
Notifications
You must be signed in to change notification settings - Fork 74k
New issue
Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.
By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.
Already on GitHub? Sign in to your account
Use the last char instead of the first in prediction #22247
Conversation
@yashk2810 does this make sense to you? I'm a little confused about what this change entails. |
So, I tried out the change and for a single character start_string, the predictions shape is (1, 65). But if the start_string is a word like 'Queen', the shape of the first prediction is (5, 65). Hence we need to use the last character from the prediction to predict the next character, hence This doesn't matter if the input is a single character. So changing to As far as temperature goes, it makes sense to remove it since tf.multinomial is not being used. @leondgarse Can you also remove the comment above the predicted_id line which mentions tf.multinomial and change the text in the markdown above? |
Replace 'a multinomial distribution' in comment by 'argmax', and also in the text introduction.
Sorry for the delay, I just replaced the sentence |
Remove a temperature line in Next Steps part
Nagging Assignee @yifeif: It has been 14 days with no activity and this issue has an assignee. Please update the label and/or status accordingly. |
PiperOrigin-RevId: 217334880
start_string
could be a string here, in my understanding, the correctly predicted next character should be the last one inpredictions
.tf.multinomial
is not used any more here,temperature
has no effect either.start_string = 'QUEEN'
, the model prediction string isUEEN:
, so the next char should be:
for i in range(num_generate):
predicted_id = tf.argmax(predictions[0]).numpy()
, output isQUEENUS:\nI think so ...
predicted_id = tf.argmax(predictions[-1]).numpy()
, output isQUEEN:\nThe grand the ...