FedDataset#
- class fl_sim.data_processing.FedDataset[source]#
Bases:
ReprMixin
,CitationMixin
,ABC
Base class for all federated datasets.
Methods that have to be implemented by subclasses:
get_dataloader
_preload
load_partition_data
load_partition_data_distributed
evaluate
Properties that have to be implemented by subclasses:
url
candidate_models
doi
- abstract evaluate(probs: Tensor, truths: Tensor) Dict[str, float] [source]#
Evaluation using predictions and ground truth.
- abstract get_dataloader(train_bs: int, test_bs: int, client_idx: int | None = None) Tuple[DataLoader, DataLoader] [source]#
Get dataloader for client client_idx or get global dataloader.
- abstract load_partition_data(batch_size: int | None = None) tuple [source]#
Partition data into all local clients.