adap / flower

Flower: A Friendly Federated AI Framework
https://flower.ai
Apache License 2.0
5.08k stars 875 forks source link

Giving weights to the contribution of each client #1871

Open ArminCod3r opened 1 year ago

ArminCod3r commented 1 year ago

Hi,

How can the effect of each client on the global model be set? (in heterogeneous environment) For example: weights = {"client1": 0.4, "client2": 0.3, "client3": 0.3}

Thanks

urwithajit9 commented 1 year ago

Hi, For theoretical understanding, you can look into the following paper, "Weighted Averaging Federated Learning Based on Example Forgetting Events in Label Imbalanced Non-IID ".

To adopt weight in averaging, you need to 1) modify the strategy, say FedAvg, and get and get parameters() method to collect weight from the client. There are good tutorials on this topic in the Flower document.

Let me know if you need more help.