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

Add SWA #519

Merged
merged 6 commits into from
Feb 13, 2023
Merged

Add SWA #519

merged 6 commits into from
Feb 13, 2023

Conversation

rayrayraykk
Copy link
Collaborator

@rayrayraykk rayrayraykk commented Feb 10, 2023

This PR is linked to #517 .

Besides SWA, I support merge_val in global evaluation.

@rayrayraykk rayrayraykk added the Feature New feature label Feb 10, 2023
@rayrayraykk rayrayraykk linked an issue Feb 10, 2023 that may be closed by this pull request
@@ -25,6 +25,14 @@ def extend_fl_algo_cfg(cfg):
cfg.fedprox.use = False
cfg.fedprox.mu = 0.

# ---------------------------------------------------------------------- #
Copy link
Collaborator

Choose a reason for hiding this comment

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

I am wondering whether it is appropriate to put SWA here. It is not an FL algorithm but just a trick to produce another solution from those in the late stage of a training course.

@@ -166,6 +166,9 @@ def _setup_server(self, resource_info=None, client_resource_info=None):
if self.cfg.vertical.use:
from federatedscope.vertical_fl.utils import wrap_vertical_server
server = wrap_vertical_server(server, self.cfg)
if self.cfg.fedswa.use:
Copy link
Collaborator

Choose a reason for hiding this comment

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

This implementation implies that, in the future, we'd better refactor the workers so that we would not need to make another worker class just for adding such a trick.

Copy link
Collaborator

@joneswong joneswong left a comment

Choose a reason for hiding this comment

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

approved.

@joneswong joneswong merged commit b58518d into alibaba:master Feb 13, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Feature New feature
Projects
None yet
Development

Successfully merging this pull request may close these issues.

Seeking Flat Minima
2 participants