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

[Feature] Enabled un-seen clients case to check the participation generalization gap #100

Merged
merged 9 commits into from Jul 13, 2022

Conversation

yxdyc
Copy link
Collaborator

@yxdyc yxdyc commented May 20, 2022

Enabled un-seen clients simulation, such that we can check the participation generalization gap, refer ICLR'22, What Do We Mean by Generalization in Federated Learning?

This PR is based on the another PR (enhanced monitor #90)

@yxdyc yxdyc added the Feature New feature label May 20, 2022
@yxdyc yxdyc added the enhancement New feature or request label Jul 12, 2022
Copy link
Collaborator

@xieyxclack xieyxclack left a comment

Choose a reason for hiding this comment

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

LGTM, please see the inline comments for minor suggestions. And I am not sure that whether setting unseen_clients would affect the behaviors of broadcasting to all neighbors in some applications.

self.server = self._setup_server()
self.server.unseen_clients_id = unseen_clients_id
Copy link
Collaborator

Choose a reason for hiding this comment

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

IMO, we have better not modify the attributes of server/client in fed_runner

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

moved it into the setup_server() as sub action of init

@@ -102,6 +115,8 @@ def _setup_for_standalone(self):
for client_id in range(1, self.cfg.federate.client_num + 1):
self.client[client_id] = self._setup_client(
client_id=client_id, client_model=self._shared_client_model)
if client_id in unseen_clients_id:
self.client[client_id].is_unseen_client = True
Copy link
Collaborator

Choose a reason for hiding this comment

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

Like above

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

moved it into the setup_server() as sub action of init

self.client_state[indices] = 1
elif state == 'working':
self.client_state[indices] = 0
if not isinstance(indices, list):
Copy link
Collaborator

Choose a reason for hiding this comment

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

Shall we cover np.array here?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

modified accordingly, besides, we used another state named "unseen"

Copy link
Collaborator

@xieyxclack xieyxclack left a comment

Choose a reason for hiding this comment

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

LGTM

@xieyxclack xieyxclack merged commit 5a760d2 into alibaba:master Jul 13, 2022
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
enhancement New feature or request Feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

None yet

2 participants