run_rounds#

fedcausal.fedges.run_rounds(learn, merge, fusion, convergence, n_rounds, on_model=None)[source]#

Run up to n_rounds rounds and return the last global DAG and the rounds run.

Parameters:
learncallable

Makes every site rebuild its model; returns them in site order.

mergecallable

Sends a global DAG for every site to merge in.

fusionFusionOperator

Combines the sites’ DAGs into the global one.

convergenceConvergence or None

Asked after every build; None runs every round.

n_roundsint

Most rounds to run.

on_modelcallable, optional

Receives every local and global model as the loop runs.

Returns:
global_dagDAG or None

None if the loop stopped before its first fusion.

roundsint

Rounds in which the sites built a model.