Strategy Client selection
One of the problems of fairly learning a model in Federated Learning is How to pick the right clients to learn a model?. Sometimes, aggregating all the models coming for the clients can lead to biased results. NOTE: Synchronus training is enough for now
Therefore, it is necessary to have a ClientSelectionStrategy
class. This class would be in charge of how to dynamically trigger client training (and aggregating their local models) at each round.
- This Strategy class should be defined at the beginning of an experiment/Job
- When no defined to an experiment/job default behavior is aggregating all clients
- Researchers should be able to propose their own strategy by extending the class
- Fedbiomed should provide some default strategies:
UniformSamplingClientStrategy
MultiNomialSamplingClientStrategy
Usage
At the definition of the experiment/job:
# Define a Stratety for client selection before starting a experiment
strategy = UniformSamplingClientStrategy()
# Define aggregator
fedavg = FedAverage()
# Include it at the moment of defining the experiment
experiment = Experiment(model_class=Net,
training_function=train,
model_args=model_args,
training_args=training_args,
rounds=10, # Future functionality: Add rounds inside job definition
on_data=data,
aggregator=fedavg, # Future functionality: include aggregator
client_selection_strategy=strategy # default: None
)
# Run Experiment (default synchronous)
# currently experiment fails if researcher fails/timeouts or infra (file repo/mqtt) fails
experiment.run()
Functionalities
- Strategies need to keep track of the clients that were selected at each round