golf_federated.server.process.strategy.selection package

Submodules

golf_federated.server.process.strategy.selection.base module

class golf_federated.server.process.strategy.selection.base.BaseSelect(client_list: List, select_num: int)[source]

Bases: object

Selection strategy base class.

abstract select() → List[source]

Abstract method for client selection.

Returns:

List: List of clients selected.

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.function.softmax_prob_from_indicators(indicators: List) → List[source]

Convert each index value into probability with softmax.

Args:

indicators (List): List of indicators.

Returns:

List: List of probabilities after softmax.

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.BaseSelect

Full selection without probability, inheriting from BaseSelect class.

select() → List[source]

Client selection.

Returns:

List: List of clients selected.

class golf_federated.server.process.strategy.selection.nonprobbased.RandomSelect(client_list: List, select_num: int)[source]

Bases: golf_federated.server.process.strategy.selection.base.BaseSelect

Random selection without probability, inheriting from BaseSelect class.

select() → List[source]

Client selection.

Returns:

List: List of clients selected.

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.BaseSelect

Random selection with probability, inheriting from BaseSelect class.

select() → List[source]

Client selection.

Returns:

List: List of clients selected.

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.BaseSelect

Ranked selection with probability, inheriting from BaseSelect class.

select() → List[source]

Client selection.

Returns:

List: List of clients selected.

Module contents