golf_federated.server.process.strategy.selection package¶
golf_federated.server.process.strategy.selection.base module¶
golf_federated.server.process.strategy.selection.function module¶
-
golf_federated.server.process.strategy.selection.function.random_pick(obj: List, prob: List) → int[source]¶ Randomly select an object from the list and get its index number.
- Args:
obj (List): Source list. prob (List): The corresponding probability of objects.
- Returns:
Int: The selected index number.
-
golf_federated.server.process.strategy.selection.function.random_select(client_list: List, client_selected_probability: List) → List[source]¶ Random client selection without limit on quantity.
- Args:
client_list (List): Total client list. client_selected_probability (List): The probability of being selected for each client.
- Returns:
List: List of selected clients.
-
golf_federated.server.process.strategy.selection.function.random_select_with_percentage(client_list: List, client_selected_probability: List, select_percentage: float) → List[source]¶ Random client selection based on a specified percentage.
- Args:
client_list (List): Total client list. client_selected_probability (List): The probability of being selected for each client. select_percentage (float): Percentage of selected clients.
- Returns:
List: List of selected clients.
-
golf_federated.server.process.strategy.selection.function.rank_select_with_percentage(client_list: List, client_selected_probability: List, select_percentage: float) → List[source]¶ Ranked client selection based on a specified percentage.
- Args:
client_list (List): Total client list. client_selected_probability (List): The probability of being selected for each client. select_percentage (float): Percentage of selected clients.
- Returns:
List: List of selected clients.
golf_federated.server.process.strategy.selection.nonprobbased module¶
-
class
golf_federated.server.process.strategy.selection.nonprobbased.AllSelect(client_list: List, select_num: int)[source]¶ Bases:
golf_federated.server.process.strategy.selection.base.BaseSelectFull selection without probability, inheriting from BaseSelect class.
-
class
golf_federated.server.process.strategy.selection.nonprobbased.RandomSelect(client_list: List, select_num: int)[source]¶ Bases:
golf_federated.server.process.strategy.selection.base.BaseSelectRandom selection without probability, inheriting from BaseSelect class.
golf_federated.server.process.strategy.selection.probbased module¶
-
class
golf_federated.server.process.strategy.selection.probbased.ProbRandomSelect(client_list: List, select_num: int, select_probability: List)[source]¶ Bases:
golf_federated.server.process.strategy.selection.base.BaseSelectRandom selection with probability, inheriting from BaseSelect class.
-
class
golf_federated.server.process.strategy.selection.probbased.ProbRankedSelect(client_list: List, select_num: int, select_probability: List)[source]¶ Bases:
golf_federated.server.process.strategy.selection.base.BaseSelectRanked selection with probability, inheriting from BaseSelect class.