nvflare.app_common.aggregators.weighted_aggregation_helper module

class WeightedAggregationHelper(exclude_vars: Optional[str] = None)[source]

Bases: object

Perform weighted aggregation.

Parameters

exclude_vars (str, optional) – regex string to match excluded vars during aggregation. Defaults to None.

add(data, weight, contributor_name, contribution_round)[source]

Compute weighted sum and sum of weights.

get_history()[source]
get_len()[source]
get_result()[source]

Divide weighted sum by sum of weights.

reset_stats()[source]