Scheme modeling activation with a 2-state Markov chain.
The scheme models activation with a 2-state (active and inactive) Markov chain. The agent transitions
between the two states with the given probabilities.
Parameters:
inactive_to_active – transition probability from inactive to active
active_to_inactive – transition probability from active to inactive
Raises:
ValueError – if inactive_to_active or active_to_inactive are not in \([0, 1]\)
Scheme where an agent cycles through active and inactive intervals.
The agent is active for active_for iterations and inactive for inactive_for iterations in each cycle.
If inactive_for is not provided, it defaults to active_for. offset shifts the phase of the cycle,
allowing agents to follow the same cycle with staggered active windows.
Parameters:
active_for – number of active iterations in each cycle.
inactive_for – number of inactive iterations in each cycle. If None, it defaults to active_for.
offset – phase offset applied to the cycle.
Raises:
ValueError – if active_for, inactive_for, or offset is negative, both intervals are zero, or
iteration is negative.
Scheme defining how to select a subset of available clients.
Federated algorithms call select() once per round with the currently active clients. Implementations
should return a subset without modifying the input sequence.
The scheme samples clients without replacement with probability proportional to each client’s local data size.
The sampling probability for client \(i\) is
Fair client selection inspired by fairness-aware client selection [2].
The scheme is a simplified count-based fairness rule that prioritizes clients with fewer past selections. It acts
as a participation-balancing exploration rule: clients selected fewer times are prioritized so that the algorithm
keeps exploring under-represented clients instead of repeatedly selecting the same ones.
At round \(t\), let \(c_i(t)\) be the number of previous rounds in which client \(i\) was selected.
For the client pool \(\mathcal{C}_t\) passed to select(), the selected set is
where \(m\) is the resolved number of selected clients. Clients with the same count keep the order in which
they were provided to select(). After selecting \(S_t\), the counts are updated as
\[c_i(t+1) = c_i(t) + \mathbf{1}\{i \in S_t\}.\]
Parameters:
num_selected_clients – number of provided clients to sample.
fraction_selected_clients – fraction of provided clients to sample.
High-loss client selection inspired by Power-of-Choice [3].
The scheme evaluates each client’s local loss at its current local state x and selects the clients with
highest loss, breaking ties at random. Unlike the Power-of-Choice strategy, this scheme does not trigger extra
communication to evaluate losses at the current server model.
At round \(t\), for the client pool \(\mathcal{C}_t\) passed to select(), the selected set is
The scheme quantizes each coordinate using n_levels stochastic levels scaled by the message norm. This keeps the
compressed message unbiased in expectation while preserving the original message shape. Given a message
\(x\) and \(s=\texttt{n\_levels}\), the quantizer computes
\[Q_s(x_i) = \lVert x \rVert_2 \operatorname{sign}(x_i) \frac{\xi_i}{s}.\]
Parameters:
n_levels – number of stochastic quantization levels. Larger values give a finer quantization grid and usually
lower quantization error. Smaller values give coarser quantization and stronger compression noise.
This scheme computes the \(\ell_2\) norm of each message. This can be computationally expensive for large
messages or when messages live on accelerator devices.
Drop scheme based on the Gilbert-Elliott model [5].
The Gilbert-Elliott model is characterized by a Markov chain with two states (good and bad), which
can stay the same or transition into each other. In the bad state message drops occur with probability
drop_rate, while in the good state no message drops occur.
Parameters:
drop_rate – message drop rate while in the bad state
bad_to_good – transition probability from bad to good state
good_to_bad – transition probability from good to bad state
Raises:
ValueError – if drop_rate, bad_to_good or good_to_bad are not in \([0, 1]\)