-
Notifications
You must be signed in to change notification settings - Fork 75
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
Adding "true" batch implementation to metrics #350
Comments
Any thoughts on this? @annahedstroem @annariasdu |
Hi @davor10105 ! Sorry for the delayed response and thanks for your correct observation about our preliminary efforts towards batching and for offering to help! The performance gains look really impressive. I would love to review your changes in a PR, where it also should become much clearer what the test scope would be. Looking forward! |
Also, I created a discord channel for us: https://discord.gg/U8PsVSv8 we can continue the communication there! |
Hi @davor10105, some time ago we used to have 2 different base classes and maintaining those got out of hand, I guess it's true, that temporary workarounds are the most permanant parts of software 😭 |
Hey @annahedstroem ,
Thank you for creating such an excellent library. I've been using it extensively in my recent research, and it's been incredibly helpful.
While working with the library, I noticed that although most metric implementations support batch processing via the
evaluate_batch
method, they do not seem to be optimized for true batch processing. Instead, they iterate over each element in the batch, concatenating the final scores at the end.I would love to contribute to your library by implementing true batch processing for these metrics. This optimization would significantly reduce evaluation times. Would you be open to this contribution?
Below, you will find code snippets showcasing my batch implementation of the
evaluate_batch
methods for the PixelFlipping and MaxSensitivity metrics. Additionally, I have included helper functions required for calculating these specific metrics. This implementation is a preliminary proof of concept, and with your approval, I would like to properly integrate these changes into the library.Following the code snippets, I have included two plots that illustrate the performance gains achieved with these modified implementations. These results are based on 30 repetitions. As shown in the figures, the true batch version for PixelFlipping is 18 times faster than the current implementation, and for MaxSensitivity, the performance gain is 2.3 times.
Results for PixelFlipping:
Results for MaxSensitivity:
Please let me know your thoughts on this suggestion and if it would be alright for me to proceed with reimplementing the metrics.
Kind regards,
Davor
The text was updated successfully, but these errors were encountered: