Skip to content

Commit

Permalink
use decomposer widget on server
Browse files Browse the repository at this point in the history
  • Loading branch information
holgerroth committed Apr 5, 2024
1 parent 019e486 commit e988aff
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 20 deletions.
22 changes: 6 additions & 16 deletions research/fed-bpt/job_templates/fedbpt/config_fed_server.conf
Original file line number Diff line number Diff line change
Expand Up @@ -33,32 +33,22 @@

# seed for CMA-ES algorithm
seed = 42

# The GlobalES controller use an persistor to load the model and save the model.
# The persistent component can be identified by component ID specified here.
# persistor_id = "persistor"
}
}
]

# List of components used in the server side workflow.
components = [
# {
# # This is the persistence component used in above workflow.
# # PTFileModelPersistor is a Pytorch persistor which save/read the model to/from file.

# id = "persistor"
# path = "nvflare.app_opt.pt.file_model_persistor.PTFileModelPersistor"
#
# # the persitor class take model class as argument
# # This imply that the model is initialized from the server-side.
# # The initialized model will be broadcast to all the clients to start the training.
# args.model.path = "{model_class_path}"
#},
{
id = "receiver"
path = "nvflare.app_opt.tracking.tb.tb_receiver.TBAnalyticsReceiver"
args.events = ["fed.analytix_log_stats"]
},
{
# we use this component so the client api `flare.init()` can get required information
id = "register_decomposer"
path = "decomposer_widget.RegisterDecomposer"
args {}
}
]

Expand Down
4 changes: 0 additions & 4 deletions research/fed-bpt/src/global_es.py
Original file line number Diff line number Diff line change
Expand Up @@ -16,7 +16,6 @@

import cma
import numpy as np
from cma_decomposer import register_decomposers

from nvflare.app_common.abstract.fl_model import FLModel
from nvflare.app_common.workflows.fedavg import FedAvg
Expand Down Expand Up @@ -63,9 +62,6 @@ def __init__(self, *args, frac=1, sigma=1, intrinsic_dim=500, seed=42, bound=0,
self.bound = bound

def run(self) -> None:
# We serialize CMAEvolutionStrategy object directly. This requires registering custom decomposers.
register_decomposers()

local_cma_mu = 0.0

m = max(int(self.frac * self._min_clients), 1)
Expand Down

0 comments on commit e988aff

Please sign in to comment.