Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Histogram Refactoring
Content: a notebook that uses refactored versions of the histogram losses, validates them using A-B testing and performs benchmark tests to compare original and refactored versions using their default parameters.
Motivation
First of all, thanks for the great work and for publishing your code🙏. I found it very useful in my own experiments.
However, I ran into performance issues when using histogram loss in my own models and decided to take a closer look at the code.
The notebook in this commit contains the results of my findings and provides some reproducible data for testing and validation as well as benchmarks to test for performance improvements if any.
Changes
I kept the public interface of the histogram blocks as-is and only sprinkled in a few type hints here and there (mainly for my own convenience as auto-complete and syntax highlighting work much better with type hints in place). The actual changes are documented within the notebook itself.
Final Thoughts
Merging this PR first is purely optional, but I thought it maybe a convenient way to test and validate the refactoring present in my other PR before merging that. The notebook is present in the other branch as well, but separated the change to make it more convenient for you to take a look at the changes first.
Sample Benchmark Plot (Google Colab)