fl4health.servers.tabular_feature_alignment_server module¶
- class TabularFeatureAlignmentServer(client_manager, config, initialize_parameters, strategy, tabular_features_source_of_truth=None, reporters=None, checkpoint_and_state_module=None, on_init_parameters_config_fn=None, server_name=None, accept_failures=True)[source]¶
Bases:
FlServer
- __init__(client_manager, config, initialize_parameters, strategy, tabular_features_source_of_truth=None, reporters=None, checkpoint_and_state_module=None, on_init_parameters_config_fn=None, server_name=None, accept_failures=True)[source]¶
This server is used when the clients all have tabular data that needs to be aligned.
- Parameters:
client_manager (ClientManager) – Determines the mechanism by which clients are sampled by the server, if they are to be sampled at all.
config (Config) – This should be the configuration that was used to setup the federated alignment. In most cases it should be the “source of truth” for how FL alignment should proceed. NOTE: This config is DISTINCT from the Flwr server config, which is extremely minimal.
strategy (Strategy | None, optional) – The aggregation strategy to be used by the server to handle. client updates and other information potentially sent by the participating clients. If None the strategy is FedAvg as set by the flwr Server.
wandb_reporter (ServerWandBReporter | None, optional) – To be provided if the server is to log information and results to a Weights and Biases account. If None is provided, no logging occurs. Defaults to None.
checkpointer (TorchCheckpointer | None, optional) – To be provided if the server should perform server side checkpointing based on some criteria. If none, then no server-side checkpointing is performed. Defaults to None.
tab_features_source_of_truth (TabularFeaturesInfoEncoder | None) – The information that is required for aligning client features. If it is not specified, then the server will randomly poll a client and gather this information from its data source.
reporters (Sequence[BaseReporter] | None, optional) – sequence of FL4Health reporters which the server should send data to before and after each round. Defaults to None.
checkpoint_and_state_module (BaseServerCheckpointAndStateModule | None, optional) – This module is used to handle both model checkpointing and state checkpointing. The former is aimed at saving model artifacts to be used or evaluated after training. The latter is used to preserve training state (including models) such that if FL training is interrupted, the process may be restarted. If no module is provided, no checkpointing or state preservation will happen. Defaults to None.
on_init_parameters_config_fn (Callable[[int], dict[str, Scalar]] | None, optional) – Function used to configure how one asks a client to provide parameters from which to initialize all other clients by providing a Config dictionary. If this is none, then a blank config is sent with the parameter request (which is default behavior for flower servers). Defaults to None.
server_name (str | None, optional) – An optional string name to uniquely identify server. This name is also used as part of any state checkpointing done by the server. Defaults to None.
accept_failures (bool, optional) – Determines whether the server should accept failures during training or evaluation from clients or not. If set to False, this will cause the server to shutdown all clients and throw an exception. Defaults to True.