Client#
- class Client[source]#
Bases:
ABC
Abstract base class for Flower clients.
Methods
evaluate
(ins)Evaluate the provided parameters using the locally held dataset.
fit
(ins)Refine the provided parameters using the locally held dataset.
Get the run context from this client.
get_parameters
(ins)Return the current local model parameters.
get_properties
(ins)Return set of client's properties.
set_context
(context)Apply a run context to this client.
Return client (itself).
Attributes
context
- evaluate(ins: EvaluateIns) EvaluateRes [source]#
Evaluate the provided parameters using the locally held dataset.
- Parameters:
ins (EvaluateIns) – The evaluation instructions containing (global) model parameters received from the server and a dictionary of configuration values used to customize the local evaluation process.
- Returns:
The evaluation result containing the loss on the local dataset and other details such as the number of local data examples used for evaluation.
- Return type:
- fit(ins: FitIns) FitRes [source]#
Refine the provided parameters using the locally held dataset.
- Parameters:
ins (FitIns) – The training instructions containing (global) model parameters received from the server and a dictionary of configuration values used to customize the local training process.
- Returns:
The training result containing updated parameters and other details such as the number of local training examples used for training.
- Return type:
- get_parameters(ins: GetParametersIns) GetParametersRes [source]#
Return the current local model parameters.
- Parameters:
ins (GetParametersIns) – The get parameters instructions received from the server containing a dictionary of configuration values.
- Returns:
The current local model parameters.
- Return type:
- get_properties(ins: GetPropertiesIns) GetPropertiesRes [source]#
Return set of client’s properties.
- Parameters:
ins (GetPropertiesIns) – The get properties instructions received from the server containing a dictionary of configuration values.
- Returns:
The current client properties.
- Return type: