openfl.component.straggler_handling_functions.straggler_handling_function.StragglerHandlingPolicy#
- class openfl.component.straggler_handling_functions.straggler_handling_function.StragglerHandlingPolicy[source]#
Bases:
ABCFederated Learning straggler handling interface.
- __init__()#
Methods
__init__()Reset policy variable for the next round.
start_policy(**kwargs)Start straggler handling policy for collaborator for a particular round.
Determines whether it is time to end the round early.
- abstract reset_policy_for_round()[source]#
Reset policy variable for the next round.
- Parameters:
None
- Returns:
None
- Return type:
None
- abstract start_policy(**kwargs)[source]#
Start straggler handling policy for collaborator for a particular round. NOTE: Refer CutoffTimeBasedStragglerHandling for reference.
- Parameters:
**kwargs
- Returns:
None
- Return type:
None
- abstract straggler_cutoff_check(num_collaborators_done, num_all_collaborators, **kwargs)[source]#
Determines whether it is time to end the round early.
- Parameters:
num_collaborators_done (int) – int Number of collaborators finished.
num_all_collaborators (int) – int Total number of collaborators.
- Returns:
True if it is time to end the round early, False otherwise.
- Return type:
bool
- Raises:
NotImplementedError – This method must be implemented by a subclass.