fedn.network.controller package

The controller package is responsible for orchestrating the federated learning process. It’s acts as a gRPC client and sends round config tasks to the fedn.network.combiner.Combiner.

Submodules

fedn.network.controller.control module

exception fedn.network.controller.control.CombinersNotDoneException(message)[source]

Bases: Exception

Exception class for when model is None

class fedn.network.controller.control.Control(statestore)[source]

Bases: ControlBase

Controller, implementing the overall global training, validation and inference logic.

Parameters:

statestore (class: fedn.network.statestorebase.StateStorageBase) – A StateStorage instance.

infer_instruct(config)[source]

Main entrypoint for executing the inference compute plan.

: param config: configuration for the inference round

inference_round(config)[source]

Execute an inference round.

: param config: configuration for the inference round

reduce(combiners)[source]

Combine updated models from Combiner nodes into one global model.

: param combiners: dict of combiner names(key) and model IDs(value) to reduce : type combiners: dict

round(session_config, round_id)[source]

Execute one global round.

: param session_config: The session config. : type session_config: dict : param round_id: The round id. : type round_id: str

session(config)[source]
Execute a new training session. A session consists of one

or several global rounds. All rounds in the same session have the same round_config.

Parameters:

config (dict) – The session config.

exception fedn.network.controller.control.MisconfiguredStorageBackend(message)[source]

Bases: Exception

Exception class for when storage backend is misconfigured.

Parameters:

message (str) – The exception message.

exception fedn.network.controller.control.NoModelException(message)[source]

Bases: Exception

Exception class for when model is None

Parameters:

message (str) – The exception message.

exception fedn.network.controller.control.UnsupportedStorageBackend(message)[source]

Bases: Exception

Exception class for when storage backend is not supported. Passes