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

Use a different value of k in top_k_categorical_accuracy #170

Open
somnathrakshit opened this issue Dec 3, 2018 · 4 comments
Open

Use a different value of k in top_k_categorical_accuracy #170

somnathrakshit opened this issue Dec 3, 2018 · 4 comments

Comments

@somnathrakshit
Copy link

How can I use a different value of k in top_k_categorical_accuracy? Is is possible to change a parameter somewhere?

@jstypka
Copy link
Collaborator

jstypka commented Dec 10, 2018

@somnathrakshit sorry, it's not easy. So the code that runs it is here, we use Keras metrics out of the box. This way, they don't support parametrizing K.

However you could define your own metric as specified here and pass it instead the one that is used right now. It would be a little bit more complicated though.

@somnathrakshit
Copy link
Author

I think that is an important parameter to have in case the number of classes is low. (e.g. <= 5) It does not make any sense to have k=5 then. Maybe I'll submit a PR after implementing the custom metric in a few days.

@jstypka
Copy link
Collaborator

jstypka commented Dec 10, 2018

@somnathrakshit yeah, we should finally build customisable metrics for Magpie, there's been requests of that already few times. We might want to be able to pass it through the external API i.e. magpie.train() and pipe them all the way through up to the Keras call. If you have time, you can open a PR and I'll look at it!

@somnathrakshit
Copy link
Author

somnathrakshit commented Dec 24, 2018

@jstypka Sorry to bother you during the holidays. Please review PR #172 when possible.

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