fix: add oov_method parameter to IntegerLookup for uniform OOV bucketing#22327
Conversation
|
Thanks for your pull request! It looks like this may be your first contribution to a Google open source project. Before we can look at your pull request, you'll need to sign a Contributor License Agreement (CLA). View this failed invocation of the CLA check for more information. For the most up to date status, view the checks section at the bottom of the pull request. |
Summary of ChangesHello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed! This pull request enhances the Highlights
🧠 New Feature in Public Preview: You can now enable Memory to help Gemini Code Assist learn from your team's feedback. This makes future code reviews more consistent and personalized to your project's style. Click here to enable Memory in your admin console. Changelog
Activity
Using Gemini Code AssistThe full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips. Invoking Gemini You can request assistance from Gemini at any point by creating a comment using either
Customization To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a Limitations & Feedback Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for Github and other Google products, sign up here. You can also get AI-powered code generation, chat, as well as code reviews directly in the IDE at no cost with the Gemini Code Assist IDE Extension. Footnotes
|
There was a problem hiding this comment.
Code Review
This pull request introduces an oov_method parameter to the IntegerLookup and base IndexLookup layers, providing an option for FarmHash64-based out-of-vocabulary (OOV) bucketing. This is a valuable addition that addresses potential non-uniformity in OOV token distribution from the default modulo-based method. The implementation is sound, maintains backward compatibility, and is well-supported by updated documentation and comprehensive tests. I have one minor suggestion to improve the clarity of the docstring in IntegerLookup.
Codecov Report✅ All modified and coverable lines are covered by tests. Additional details and impacted files@@ Coverage Diff @@
## master #22327 +/- ##
==========================================
+ Coverage 82.73% 82.94% +0.20%
==========================================
Files 594 595 +1
Lines 65732 66087 +355
Branches 10266 10313 +47
==========================================
+ Hits 54385 54816 +431
+ Misses 8711 8657 -54
+ Partials 2636 2614 -22
Flags with carried forward coverage won't be shown. Click here to find out more. ☔ View full report in Codecov by Sentry. 🚀 New features to boost your workflow:
|
|
Thanks! Lgtm with one style nit |
Summary
Testing
Verified pytest keras/src/layers/preprocessing ran locally
Fixes #22325