Sets Sampling Strategy#
- class rizemind.strategies.contribution.sampling.sets_sampling_strat.SetsSamplingStrategy[source]
Bases:
ABCAbstract strategy for sampling trainer sets during federated learning rounds.
This abstract base class defines the interface for strategies that create sets of trainers to evaluate during contribution assessment.
- abstractmethod get_set(round_id: int, id: str) TrainerSet[source]
Returns a specific trainer set by ID for the specified round.
- Parameters:
round_id – The round identifier to retrieve the set from.
id – The unique identifier of the trainer set to retrieve.
- abstractmethod get_sets(round_id: int) list[TrainerSet][source]
Returns all trainer sets for the specified round.
- Parameters:
round_id – The round identifier to retrieve sets for.
- abstractmethod get_trainer_mapping(round_id: int) ParticipantMapping[source]
Returns the participant mapping for the specified round.
- Parameters:
round_id – The round identifier to retrieve the mapping for.
- abstractmethod sample_trainer_sets(server_round: int, results: list[tuple[ClientProxy, FitRes]]) list[TrainerSet][source]
Samples and generates trainer sets for the given round.
- Parameters:
server_round – The current server round number.
results – A list of tuples containing client proxies and their
round. (corresponding fit results from the training)
- Returns:
A list of TrainerSet objects representing the sampled combinations of trainers for this round.