Server

The server is the orchestrator of the training, aggregating the results from the clients to improve the global model. As the clients, it is independent of the machine learning tools. The server can evaluate the global model by proxying an evaluate() function.

App

Entry point to start the CentralNode. The server must be started before launching clients.

CentralNode

Data structure containing the server's configuration and its API for communicating with the nodes.

Fed.Server.CentralNodeType
CentralNode(host, port, weights, strategy, evaluate, config)

Orchestrate the entire federated learning process. It handles the clients registration and requests them to train on their local data.

source
Fed.Server.fitFunction
fit(central_node::CentralNode)

Fit the global model by orchestrating the federated training.

source
Fed.Server.fit_clientFunction
fit_client(url::String, payload::Vector{UInt8})

Ask one client to train on its local data, by using the model weights contained in the payload. Return the serialized updated weights.

source
Fed.Server.fit_clientsFunction
fit_clients(endpoint::String, clients::Vector{String}, payload::Vector{UInt8})

Ask asynchronously each client from clients to train on their local data by using the model weights contained in the payload. Return a Vector where each element is the serialized weights of one client.

source
Fed.Server.register_client!Function
register_client!(cm::ClientManager, req::HTTP.Request)

Register a new client in the ClientManager. The body of the request should contain the client URL: http://hostname:port.

Info

API Endpoint: this is an HTTP server endpoint.

source

ClientManager

The ClientManager handles the nodes registrations and synchronize the server to make it start when the clients are ready.

Fed.Server.ClientManagerType
ClientManager()

Structure which manages the clients registration and syncrhonizes the server to make it work with them.

source
Base.lengthMethod
length(cm::ClientManager)

Return the number of client managed by the ClientManager.

source
Fed.Server.register!Function
register!(cm::ClientManager, client_url::String)

Register a new client_url.

Example

register!(cm, "http://127.0.0.1:8081")
source
Fed.Server.sample_clientsFunction
sample_clients(cm::ClientManager, fraction::Float32)

Sample randomly fraction% of the clients, without replacement. Return at least one client if the number of available clients > 0.

source
Fed.Server.wait_forFunction
wait_for(cm::ClientManager, num_clients::Int)

Block until at least num_clients are available.

source

Strategy