Client
Table of Contents
- client.client_state
- ClientState
- client.client_output
- ClientOutput
- client.client_fn
- ClientFunction
- client.client
- Client
- client.helpers
- get_parameters
- set_parameters
client.client_state
Client state class
ClientState Objects
Utility class for handling client state
get
Get attribute from state
Arguments:
attr: Attribute to get
Returns:
Value of attribute
get_all
Get all attributes from state
Returns:
Dictionary of all attributes
client.client_output
Utility class for handling client output
ClientOutput Objects
set
Set output key to values
Arguments:
key: String or integer keyvalue: Value to set
get
Get output value for key
Arguments:
key: String or integer key
Returns:
Value for key
write
Write output
client.client_fn
Wrapper to allow Ray to create clients
ClientFunction Objects
Class used to create clients
client_fn
Function used to create clients
Arguments:
cid: The client id
Returns:
Instance of the client class
client.client
Client class for the federated learning framework
Client Objects
fit
Fit the model, write output and return parameters and metrics
Arguments:
parameters: The current parameters of the global modelconfig: Configuration for this fit
Returns:
The parameters of the global model, the number of samples used and the metrics
evaluate
Evaluate the model
Arguments:
parameters: model parametersconfig: configuration for this evaluation
Returns:
loss, number of samples and metrics
get_properties
Return properties of the current client
Arguments:
config: Config for getting the properties
client.helpers
Helper functions for the client Specifically, this file contains the following functions: - get_parameters: Returns the parameters of a model as a list of numpy arrays - set_parameters: Sets the parameters of a model from a list of numpy arrays
get_parameters
Returns the parameters of a model as a list of numpy arrays
Arguments:
net: The model
Returns:
The parameters of the model as a list of numpy arrays
set_parameters
Sets the parameters of a model from a list of numpy arrays
Arguments:
net: The modelparameters: The parameters of the model as a list of numpy arrays
Returns:
None