Conversation
Contributor
Eugene-hu
commented
Jun 8, 2023
- Fixes the scatter in the validator to reward only those that queried
- Adds in additional normalization for followup and answer rewards
adriansmares
reviewed
Jun 9, 2023
openvalidators/forward.py
Outdated
| self.moving_averaged_scores.scatter(0, answer_uids, answer_rewards) | ||
| ) | ||
| rewards = scattered_followup_rewards + scattered_answer_rewards | ||
| rewards = (scattered_followup_rewards + scattered_answer_rewards)/2 |
There was a problem hiding this comment.
So you're dividing by 2 since the UIDs outside of followup_uids and answer_uids will be added twice, but you're also halving the score for the UIDs in followup_uids and answer_uids.
Why not scatter the answer rewards over the scattered follow up rewards ? followup_uids and answer_uids are disjoint, and then you count the scores of the UIDs which were not queried only once, without changing other scores.
Contributor
There was a problem hiding this comment.
Maybe something like this, given that we make followup_uids and answer_uids mutually exclusive.
# Compute forward pass rewards, assumes followup_uids and answer_uids are mutually exclusive.
rewards = self.moving_averaged_scores.scatter(0, followup_uids, followup_rewards)
rewards = rewards.scatter(0, answer_uids, answer_rewards)
opentaco
approved these changes
Jun 9, 2023
shibshib
approved these changes
Jun 9, 2023
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
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.