Skip to content
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

sample() with temperature #7

Open
RodinIvan opened this issue Jul 24, 2018 · 1 comment
Open

sample() with temperature #7

RodinIvan opened this issue Jul 24, 2018 · 1 comment

Comments

@RodinIvan
Copy link

I've implemented run your network on my data, and seems that it struggles sometimes in generating texts - it just generates the sequence of dots of 'a a a a a a'.
Can you advise, how can I modify sample() function to generate texts with temperature parameter? Seems that it can help.

@alecwangcq
Copy link
Owner

You can divide outputs (which is the logit) in the sample function of models.py by the desired temperature, the feed it torch.multinomial for sampling.
But if you do greedy decoding, the temperature will not make any differences to the result.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants