-
Notifications
You must be signed in to change notification settings - Fork 13
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
Conversation
@@ -29,7 +29,7 @@ class ProposedWeights(BaseModel): | |||
weights: Weights | |||
vote_score: float | |||
test_score: float | |||
vote: bool | |||
vote: Optional[bool] |
There was a problem hiding this comment.
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
There was a problem hiding this 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?
colearn/standalone_driver.py
Outdated
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) |
There was a problem hiding this comment.
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().
There was a problem hiding this comment.
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!
colearn/utils/plot.py
Outdated
|
||
# 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') |
There was a problem hiding this comment.
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: |
There was a problem hiding this comment.
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
colearn/standalone_driver.py
Outdated
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) |
There was a problem hiding this comment.
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!
Looks like: