Average

Average aggregation rule, non-robust baseline.

Reference:

Brendan McMahan, Eider Moore, Daniel Ramage, Seth Hampson, and Blaise Aguera y Arcas. “Communication-Efficient Learning of Deep Networks from Decentralized Data.” In Proceedings of the 20th International Conference on Artificial Intelligence and Statistics (AISTATS 2017).

class aggregators.average.Average[source]

Bases: Aggregator

Average aggregation rule, non-robust baseline.

Included as a non-robust baseline. A single adversarial worker with an arbitrarily large gradient can drive the aggregated gradient arbitrarily far from the honest mean, so this rule has no Byzantine resilience guarantees.

classmethod aggregate(gradients: Sequence[Tensor] | Tensor, /, out: Tensor | None = None, **specialized: Any) Tensor[source]

Aggregate the gradients.

Parameters:
  • gradients – Sequence of 1-D tensors containing gradients from workers, or a pre-stacked 2-D tensor of shape \((n, d)\).

  • out – Optional pre-allocated tensor to write the result into.

  • **specialized – Additional keyword arguments.

Returns:

Element-wise mean of the gradients, of shape `` (d,)

See also

For coordinate-wise robustness, see Median. For distance-based selection, see Krum or Bulyan.