nvflare.private.fed.client.fed_client_base module¶
- class FederatedClientBase(client_name, client_args, secure_train, server_args=None, retry_timeout=30, client_state_processors: Optional[List[Filter]] = None, handlers: Optional[List[FLComponent]] = None, compression=None, overseer_agent=None, args=None, components=None)[source]¶
Bases:
object
The client-side base implementation of federated learning.
This class provide the tools function which will be used in both FedClient and FedClientLite.
To init FederatedClientBase.
- Parameters
client_name – client name
client_args – client config args
secure_train – True/False to indicate secure train
server_args – server config args
retry_timeout – retry timeout
client_state_processors – client state processor filters
handlers – handlers
compression – communication compression algorithm
- aux_send(topic, shareable: Shareable, timeout: float, fl_ctx: FLContext)[source]¶
Push the local model to multiple servers.
- client_register(project_name)[source]¶
Register the client to the FL server.
- Parameters
project_name – FL study project name.
- fetch_execute_task(project_name, fl_ctx: FLContext)[source]¶
Fetch a task from the server.
- Parameters
project_name – FL study project name
fl_ctx – FLContext
- Returns
A CurrentTask message from server
- push_execute_result(project_name, shareable: Shareable, fl_ctx: FLContext)[source]¶
Submit execution results of a task to server.
- Parameters
project_name – FL study project name
shareable – Shareable object
fl_ctx – FLContext
- Returns
A FederatedSummary message from the server.
- push_results(shareable: Shareable, fl_ctx: FLContext)[source]¶
Push the local model to multiple servers.
- quit_remote(task_name, fl_ctx: FLContext)[source]¶
Sending the last message to the server before leaving.
- Parameters
task_name – task name
fl_ctx – FLContext
Returns: N/A
- send_aux_message(project_name, topic: str, shareable: Shareable, timeout: float, fl_ctx: FLContext)[source]¶
Send auxiliary message to the server.
- Parameters
project_name – FL study project name
topic – aux topic name
shareable – Shareable object
timeout – communication timeout
fl_ctx – FLContext
- Returns
A reply message