-
I would like to set the aggregation weights to be equal to the number of training samples for each client, I cannot see any example of this in the examples, only setting fix weights. I will run many trainings with different data for my clients, and I want the client weights to be set automatically, so I don't have to write it manually every time. |
Beta Was this translation helpful? Give feedback.
Replies: 2 comments 2 replies
-
@ZiyueXu77 can you share the example where this is set ? |
Beta Was this translation helpful? Give feedback.
-
With the default learner/aggregator, the aggr weights are set to the number of traning samples, by transfering the below MetaKey in the local learner ("MetaKey.NUM_STEPS_CURRENT_ROUND") in To clarify, the "aggregation_weights" in the config json is in fact an "additional weight", that can be further set as And the two will be multiplied in the server aggregator as |
Beta Was this translation helpful? Give feedback.
With the default learner/aggregator, the aggr weights are set to the number of traning samples, by transfering the below MetaKey in the local learner ("MetaKey.NUM_STEPS_CURRENT_ROUND") in
https://github.com/NVIDIA/NVFlare/blob/main/examples/hello-world/hello-pt/jobs/hello-pt/app/custom/cifar10trainer.py#L145
To clarify, the "aggregation_weights" in the config json is in fact an "additional weight", that can be further set as
https://github.com/NVIDIA/NVFlare/blob/main/examples/hello-world/hello-pt/jobs/hello-pt/app/config/config_fed_server.json#L25C1-L27C24
And the two will be multiplied in the server aggregator as
https://github.com/NVIDIA/NVFlare/blob/main/nvflare/app_common/aggregator…