Skip to content
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

do not vote on own weights #185

Merged
merged 9 commits into from
Dec 15, 2021
Merged

do not vote on own weights #185

merged 9 commits into from
Dec 15, 2021

Conversation

n-hutton
Copy link
Contributor

@n-hutton n-hutton commented Dec 8, 2021

Looks like:

image

@@ -29,7 +29,7 @@ class ProposedWeights(BaseModel):
weights: Weights
vote_score: float
test_score: float
vote: bool
vote: Optional[bool]
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

None indicates own vote/invalid

Copy link
Contributor

@evsmithx evsmithx left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I think the gRPC interface will be broken by this because it has vote: bool. Can you modify that as well?

learner.mli_accept_weights(prop_weights_list[j].weights)
# Set all learners to new weights
for _, learner in enumerate(learners):
learner.mli_accept_weights(prop_weights_list[0].weights)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Minor, but this code would be equivalent and clearer if new_weights replaced prop_weights_list[0].weights. Also if you're not using the loop index then you can get rid of enumerate().

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You marked the conversation as resolved but you haven't fixed it!


# make extra legend entries
red_patch_handle = mpatches.Patch(color=red_colour / 256, label='Negative vote')
green_patch_handle = mpatches.Patch(color=green_colour / 256, label='Positive vote')
grey_patch_handle = mpatches.Patch(color=grey_colour / 256, label='N/A vote')
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

"Did not vote" would be a better label.

@@ -181,7 +181,8 @@ def TestWeights(self, request_iterator, context):
proposed_weights = self.learner.mli_test_weights(weights)
pw.vote_score = proposed_weights.vote_score
pw.test_score = proposed_weights.test_score
pw.vote = proposed_weights.vote
if proposed_weights.vote is not None:
Copy link
Contributor Author

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

grpc allows you to not specify values

evsmithx
evsmithx previously approved these changes Dec 15, 2021
learner.mli_accept_weights(prop_weights_list[j].weights)
# Set all learners to new weights
for _, learner in enumerate(learners):
learner.mli_accept_weights(prop_weights_list[0].weights)
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

You marked the conversation as resolved but you haven't fixed it!

@evsmithx evsmithx merged commit 95d4376 into master Dec 15, 2021
@evsmithx evsmithx deleted the feature/vote_only_self branch December 15, 2021 17:05
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants