-
Notifications
You must be signed in to change notification settings - Fork 214
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
[feature] samplers #200
[feature] samplers #200
Conversation
idle_clients = np.nonzero(self.client_state)[0] | ||
sampled_clients = np.random.choice(idle_clients, | ||
size=size, | ||
replace=False).tolist() |
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.
Is it possible to make this argument configurable?
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.
Do you mean replace
? It should be set to False
to avoid sampling repeated clients.
def __init__(self, client_num): | ||
self.client_state = np.asarray([1] * (client_num + 1)) | ||
# Set the state of server (index=0) to 'working' | ||
self.client_state[0] = 0 |
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.
it is very confusing. Server state is maintained in an array named "client_state"
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.
Since 'client_id' is numbered from 1 to M, index=0
for client_state
is redundant. Although client_state[0]
is used for server_state
, it would not be modified during the training process.
Maybe we can declare it in the comments.
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.
LGTM
The sampler is used to sample clients from the idle clients at each training round