openfl.interface.aggregation_functions.geometric_median.geometric_median

openfl.interface.aggregation_functions.geometric_median.geometric_median#

openfl.interface.aggregation_functions.geometric_median.geometric_median(tensors, weights, maxiter=4, eps=1e-05, ftol=1e-06)[source]#

Compute geometric median of tensors with weights using Weiszfeld’s Algorithm.

Parameters:
  • tensors (list) – List of tensors.

  • weights (list) – List of weights corresponding to the tensors.

  • maxiter (int, optional) – Maximum number of iterations. Defaults to 4.

  • eps (float, optional) – Epsilon value for stability. Defaults to 1e-5.

  • ftol (float, optional) – Tolerance for convergence. Defaults to 1e-6.

Returns:

The geometric median of the tensors.

Return type:

median (np.ndarray)