FedDataset#
- class fl_sim.data_processing.FedDataset[源代码]#
基类:
ReprMixin,CitationMixin,ABCBase 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][源代码]#
Evaluation using predictions and ground truth.
- abstract get_dataloader(train_bs: int, test_bs: int, client_idx: int | None = None) Tuple[DataLoader, DataLoader][源代码]#
Get dataloader for client client_idx or get global dataloader.
- abstract load_partition_data(batch_size: int | None = None) tuple[源代码]#
Partition data into all local clients.
- abstract load_partition_data_distributed(process_id: int, batch_size: int | None = None) tuple[源代码]#
Get local dataloader at client process_id or get global dataloader