You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
The reason will be displayed to describe this comment to others. Learn more.
Code Review
This pull request renames SyntheticDataGenerator to BadmintonDataGenerator across the codebase and documentation, updates pre-commit hook versions, and fixes type mismatch issues in metrics. Feedback highlights an opportunity to simplify user ID selection logic for better robustness and points out a performance regression in the basic attention notebook where a vectorized prediction call was replaced by an inefficient loop.
I am having trouble creating individual review comments. Click here to see my feedback.
The selection of a random user ID is improved by using np.random.choice, which supports non-sequential keys. However, list(self.user_profile.keys()) can be simplified to list(self.user_profile). Additionally, using if self.user_profile: instead of if self.user_profile is not None would safely handle cases where an empty dictionary is provided, avoiding a ValueError in np.random.choice.
np.random.choice(list(self.user_profile)) if self.user_profile else 0
Replacing the vectorized model.predict call with a Python loop that calls compute_item_likelihood for each context individually is significantly less efficient. If model.predict is still available in the API, it should be used to leverage TensorFlow's batch processing capabilities. If the API has changed, consider providing a vectorized way to compute these likelihoods in the tutorial.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
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.
No description provided.