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

Returning N top predictions #55

Closed
andresti opened this issue Feb 2, 2022 · 2 comments
Closed

Returning N top predictions #55

andresti opened this issue Feb 2, 2022 · 2 comments

Comments

@andresti
Copy link

andresti commented Feb 2, 2022

Hi,
I have a use case where I need multiple predictions and their probabilities - if the model is not confident enough in the prediction, the user gets a choice of N top predictions to choose the correct one themselves.

I've modified the fastinference code to implement this functionality (at the moment I just return a sorted list of all classes and their probabilities). Would you be interested in having it as a pull request? I haven't measured the speed and the code is a bit hacky at the moment, so I would need to clean it up first and integrate with the original functionality.

@muellerzr
Copy link
Owner

That's a bit too magic-y for me. Plus, you should already be able to do so with get_preds. Just pass in act=noop when getting predictions.

@andresti
Copy link
Author

andresti commented Feb 3, 2022

What does passing act=noop actually do? I can't see any difference and it doesn't seem that such parameter is used anywhere anyhow.

Anyway, get_preds only gives the label of the class with the largest probability, that's why I modified it. I guess I can calculate what I need from the probabilities array, but I figured it could be a bit faster if done inside get_preds.

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