FaultTolerantFedAvg#

class FaultTolerantFedAvg(*, fraction_fit: float = 1.0, fraction_evaluate: float = 1.0, min_fit_clients: int = 1, min_evaluate_clients: int = 1, min_available_clients: int = 1, evaluate_fn: Callable[[int, list[numpy.ndarray[Any, numpy.dtype[Any]]], dict[str, Union[bool, bytes, float, int, str]]], tuple[float, dict[str, Union[bool, bytes, float, int, str]]] | None] | None = None, on_fit_config_fn: Callable[[int], dict[str, Union[bool, bytes, float, int, str]]] | None = None, on_evaluate_config_fn: Callable[[int], dict[str, Union[bool, bytes, float, int, str]]] | None = None, min_completion_rate_fit: float = 0.5, min_completion_rate_evaluate: float = 0.5, initial_parameters: Parameters | None = None, fit_metrics_aggregation_fn: Callable[[list[tuple[int, dict[str, Union[bool, bytes, float, int, str]]]]], dict[str, Union[bool, bytes, float, int, str]]] | None = None, evaluate_metrics_aggregation_fn: Callable[[list[tuple[int, dict[str, Union[bool, bytes, float, int, str]]]]], dict[str, Union[bool, bytes, float, int, str]]] | None = None)[소스]#

기반 클래스: FedAvg

Configurable fault-tolerant FedAvg strategy implementation.

메소드

aggregate_evaluate(server_round, results, ...)

Aggregate evaluation losses using weighted average.

aggregate_fit(server_round, results, failures)

Aggregate fit results using weighted average.

configure_evaluate(server_round, parameters, ...)

Configure the next round of evaluation.

configure_fit(server_round, parameters, ...)

Configure the next round of training.

evaluate(server_round, parameters)

Evaluate model parameters using an evaluation function.

initialize_parameters(client_manager)

Initialize global model parameters.

num_evaluation_clients(num_available_clients)

Use a fraction of available clients for evaluation.

num_fit_clients(num_available_clients)

Return the sample size and the required number of available clients.

aggregate_evaluate(server_round: int, results: list[tuple[flwr.server.client_proxy.ClientProxy, flwr.common.typing.EvaluateRes]], failures: list[Union[tuple[flwr.server.client_proxy.ClientProxy, flwr.common.typing.EvaluateRes], BaseException]]) tuple[Optional[float], dict[str, Union[bool, bytes, float, int, str]]][소스]#

Aggregate evaluation losses using weighted average.

aggregate_fit(server_round: int, results: list[tuple[flwr.server.client_proxy.ClientProxy, flwr.common.typing.FitRes]], failures: list[Union[tuple[flwr.server.client_proxy.ClientProxy, flwr.common.typing.FitRes], BaseException]]) tuple[Optional[flwr.common.typing.Parameters], dict[str, Union[bool, bytes, float, int, str]]][소스]#

Aggregate fit results using weighted average.

configure_evaluate(server_round: int, parameters: Parameters, client_manager: ClientManager) list[tuple[flwr.server.client_proxy.ClientProxy, flwr.common.typing.EvaluateIns]]#

Configure the next round of evaluation.

configure_fit(server_round: int, parameters: Parameters, client_manager: ClientManager) list[tuple[flwr.server.client_proxy.ClientProxy, flwr.common.typing.FitIns]]#

Configure the next round of training.

evaluate(server_round: int, parameters: Parameters) tuple[float, dict[str, Union[bool, bytes, float, int, str]]] | None#

Evaluate model parameters using an evaluation function.

initialize_parameters(client_manager: ClientManager) Parameters | None#

Initialize global model parameters.

num_evaluation_clients(num_available_clients: int) tuple[int, int]#

Use a fraction of available clients for evaluation.

num_fit_clients(num_available_clients: int) tuple[int, int]#

Return the sample size and the required number of available clients.