Skip to content

how to handle tokens with 0 or 100% probability #4

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

Open
shiffman opened this issue Oct 14, 2017 · 2 comments
Open

how to handle tokens with 0 or 100% probability #4

shiffman opened this issue Oct 14, 2017 · 2 comments

Comments

@shiffman
Copy link
Collaborator

This is what I'm doing now:

if (word[category].prob < 0.01) word[category].prob = 0.01;
if (word[category].prob > 0.99) word[category].prob = 0.99;
@AlcaDesign
Copy link
Contributor

A basic constraint:

word[category].prob = Math.max(0.01, Math.min(0.99, word[category].prob));

@shiffman
Copy link
Collaborator Author

Yes, this would be an improvement over my code! Feel free to implement that. I will leave this open, however, as I'm wondering if there is a different or more appropriate mathematical solution?

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