run_server_loop#

fedcausal.flower.fedges.run_server_loop(grid, *, n_clients, n_rounds=10, global_fusion=None, convergence=None, min_clients=None, on_model=None, context=None)[source]#

Run the FedGES rounds over grid and return the final global DAG.

Parameters:
gridGrid

Anything that can send and receive Flower messages.

n_clientsint

Supernodes to wait for before the first round.

n_roundsint, default=10

Most rounds to run.

global_fusionFusionOperator, optional

Default Consensus(50).

convergenceConvergence, optional

Default: no score improvement, or every model repeated.

min_clientsint, optional

Usable replies a round needs. Default n_clients, so a failed site stops the run; lower it to tolerate dropouts.

on_modelcallable, optional

Receives every local and global model; see RoundCallback.

contextContext, optional

The server’s context. If given, the final global DAG is also stored on context.state["global_dag"].

Returns:
DAG or None

None if the rounds stopped before the first fusion.

Raises:
ConfigurationError

If min_clients is not between 1 and n_clients.

ClientFailureError

If too few supernodes register, or too few reply in a round.

SchemaMismatchError

If the sites disagree on their variables.