-
Notifications
You must be signed in to change notification settings - Fork 525
Support Hindsight PR in TorchRec #2627
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
Closed
Closed
Conversation
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
This pull request was exported from Phabricator. Differential Revision: D65867461 |
iamzainhuda
pushed a commit
to iamzainhuda/torchrec
that referenced
this pull request
Dec 10, 2024
Summary: ### Overview This diff implements HindsightTargetPR metric into TorchRec. This will also include a bucketized version. Thrift changes submitted ahead in D66216486. ### Implementation 1) Create X-wide granular array to store metric states where each index represents the threshold. For bucketization, each bucket will be stacked in the next dimension within the state tensor. 2) Calculate minimum threshold that meets target_precision. 3) Calculate precision and recall points with target threshold. ### Metrics This metric will return the following curves: * hindsight_target_pr: this is the calculated threshold for the window state to maximize recall while achieving the target precision. * hindsight_target_precision: this is the achieved precision with hindsight_target_pr. * hindsight_target_recall: this is the achieved recall with hindsight_target_pr. ### Usage Hindsight PR metrics are primarily useful to mimic the calibration system within identity team. Please adjust the bucketization and window size accordingly to best approximate this. Note: since the states are stored as a dimensional tensor, multiple tasks will not be supported for this metric. Reviewed By: iamzainhuda Differential Revision: D65867461
4b178bc
to
8eb0014
Compare
This pull request was exported from Phabricator. Differential Revision: D65867461 |
iamzainhuda
pushed a commit
to iamzainhuda/torchrec
that referenced
this pull request
Dec 10, 2024
Summary: ### Overview This diff implements HindsightTargetPR metric into TorchRec. This will also include a bucketized version. Thrift changes submitted ahead in D66216486. ### Implementation 1) Create X-wide granular array to store metric states where each index represents the threshold. For bucketization, each bucket will be stacked in the next dimension within the state tensor. 2) Calculate minimum threshold that meets target_precision. 3) Calculate precision and recall points with target threshold. ### Metrics This metric will return the following curves: * hindsight_target_pr: this is the calculated threshold for the window state to maximize recall while achieving the target precision. * hindsight_target_precision: this is the achieved precision with hindsight_target_pr. * hindsight_target_recall: this is the achieved recall with hindsight_target_pr. ### Usage Hindsight PR metrics are primarily useful to mimic the calibration system within identity team. Please adjust the bucketization and window size accordingly to best approximate this. Note: since the states are stored as a dimensional tensor, multiple tasks will not be supported for this metric. Reviewed By: iamzainhuda Differential Revision: D65867461
8eb0014
to
5f4bab8
Compare
This pull request was exported from Phabricator. Differential Revision: D65867461 |
Summary: ### Overview This diff implements HindsightTargetPR metric into TorchRec. This will also include a bucketized version. Thrift changes submitted ahead in D66216486. ### Implementation 1) Create X-wide granular array to store metric states where each index represents the threshold. For bucketization, each bucket will be stacked in the next dimension within the state tensor. 2) Calculate minimum threshold that meets target_precision. 3) Calculate precision and recall points with target threshold. ### Metrics This metric will return the following curves: * hindsight_target_pr: this is the calculated threshold for the window state to maximize recall while achieving the target precision. * hindsight_target_precision: this is the achieved precision with hindsight_target_pr. * hindsight_target_recall: this is the achieved recall with hindsight_target_pr. ### Usage Hindsight PR metrics are primarily useful to mimic the calibration system within identity team. Please adjust the bucketization and window size accordingly to best approximate this. Note: since the states are stored as a dimensional tensor, multiple tasks will not be supported for this metric. Reviewed By: iamzainhuda Differential Revision: D65867461
5f4bab8
to
69dc737
Compare
This pull request was exported from Phabricator. Differential Revision: D65867461 |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Labels
CLA Signed
This label is managed by the Facebook bot. Authors need to sign the CLA before a PR can be reviewed.
fb-exported
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.
Summary:
Pull request TDB after approvals.
Overview
This diff implements HindsightTargetPR metric into TorchRec. This will also include a bucketized version. Thrift changes submitted ahead in D66216486.
Implementation
Metrics
This metric will return the following curves:
Usage
Hindsight PR metrics are primarily useful to mimic the calibration system within identity team. Please adjust the bucketization and window size accordingly to best approximate this.
Note: since the states are stored as a dimensional tensor, multiple tasks will not be supported for this metric.
Differential Revision: D65867461