客户端

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_parameters(ins)

Return the current local model parameters.

get_properties(ins)

Return set of client's properties.

to_client()

Return client (itself).

evaluate(ins: EvaluateIns) EvaluateRes[source]

Evaluate the provided parameters using the locally held dataset.

参数:

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.

返回:

The evaluation result containing the loss on the local dataset and other details such as the number of local data examples used for evaluation.

返回类型:

EvaluateRes

fit(ins: FitIns) FitRes[source]

Refine the provided parameters using the locally held dataset.

参数:

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.

返回:

The training result containing updated parameters and other details such as the number of local training examples used for training.

返回类型:

FitRes

get_parameters(ins: GetParametersIns) GetParametersRes[source]

Return the current local model parameters.

参数:

ins (GetParametersIns) -- The get parameters instructions received from the server containing a dictionary of configuration values.

返回:

The current local model parameters.

返回类型:

GetParametersRes

get_properties(ins: GetPropertiesIns) GetPropertiesRes[source]

Return set of client's properties.

参数:

ins (GetPropertiesIns) -- The get properties instructions received from the server containing a dictionary of configuration values.

返回:

The current client properties.

返回类型:

GetPropertiesRes

to_client() Client[source]

Return client (itself).