Skip to content

Commit

Permalink
add docstring
Browse files Browse the repository at this point in the history
  • Loading branch information
rayrayraykk committed Dec 13, 2022
1 parent 42a3e51 commit 47c256a
Show file tree
Hide file tree
Showing 3 changed files with 18 additions and 1 deletion.
9 changes: 9 additions & 0 deletions federatedscope/autotune/run.py
Original file line number Diff line number Diff line change
@@ -1,4 +1,13 @@
def run_scheduler(scheduler, cfg, client_cfgs=None):
"""
This function is to optimize FedHPO problem by scheduler. The method is
decided by `cfg.hpo.scheduler`.
Args:
scheduler: Scheduler for conducting serval FS runs, \
see ``federatedscope.autotune.algos.Scheduler``
cfg: The configurations of the FL course.
client_cfgs: The clients' configurations.
"""
if cfg.hpo.scheduler in ['sha', 'wrap_sha']:
_ = scheduler.optimize()
elif cfg.hpo.scheduler in [
Expand Down
8 changes: 8 additions & 0 deletions federatedscope/autotune/smac.py
Original file line number Diff line number Diff line change
Expand Up @@ -15,6 +15,14 @@ def run_smac(cfg, scheduler, client_cfgs=None):
perfs = []

def optimization_function_wrapper(config):
"""
Used as an evaluation function for SMAC optimizer.
Args:
config: configurations of FS run.
Returns:
Best results of server of specific FS run.
"""
budget = cfg.hpo.sha.budgets[-1]
results = eval_in_fs(cfg, config, budget, client_cfgs)
key1, key2 = cfg.hpo.metric.split('.')
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -10,7 +10,7 @@

def wrap_instance_norm_server(worker):
"""
This function is to perform instance norm vfl tabular data for server.
This function is to perform instance norm on vfl tabular data for server.
Args:
worker: ``federatedscope.core.workers.Worker`` to be wrapped
Expand Down

0 comments on commit 47c256a

Please sign in to comment.