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

Convert logprobs (sometimes positive) to regular probabilities? #18

Open
anatol-grabowski opened this issue Aug 6, 2023 · 2 comments
Open

Comments

@anatol-grabowski
Copy link

anatol-grabowski commented Aug 6, 2023

Hey. How does one convert logprobs to regular probabilities? I've tried np.exp(token.logprob) expecting them to be always negative. But sometimes they are positive. Need some explanation on how to handle those.

@anatol-grabowski
Copy link
Author

Realized that it is impossible to get probability from just one of the logits.
Used a variation of this code to get an estimate for the probability.

@abb128
Copy link
Owner

abb128 commented Aug 6, 2023

I think it may be necessary to add a softmax layer to the output to achieve this. I'll look into it when I get around to training another model

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