fl4health.clients.fed_pca_client module¶
- class FedPCAClient(data_path, device, model_save_path)[source]¶
Bases:
NumPyClient
- __init__(data_path, device, model_save_path)[source]¶
Client that facilitates the execution of federated PCA.
- Parameters:
data_path (Path) – path to the data to be used to load the data for client-side training
device (torch.device) – Device indicator for where to send the model, batches, labels etc. Often ‘cpu’ or ‘cuda’
model_save_path (Path) – Path to save the PCA components for use later, perhaps in dimensionality reduction
- evaluate(parameters, config)[source]¶
Evaluate merged principal components on the local validation set.
- get_data_loaders(config)[source]¶
User defined method that returns a PyTorch Train DataLoader and a PyTorch Validation DataLoader
- Return type:
tuple
[DataLoader
,DataLoader
]