Code
Hub
Workspaces
Following
Trending
Connect
MCP
copy
Create free account
hub
/
github.com/KarhouTam/FL-bench
/ functions
Functions
580 in github.com/KarhouTam/FL-bench
⨍
Functions
580
◇
Types & classes
144
↓ 1 callers
Method
align_federated_parameters
(self)
src/client/fedas.py:58
↓ 1 callers
Function
allocate_shards
Allocate data shards to clients based on the method described in the FedAvg paper. The data is sorted by label and then split into `shard_num *
data/utils/schemes/shards.py:8
↓ 1 callers
Function
balanced_softmax_loss
( logits: torch.Tensor, targets: torch.Tensor, gamma: float, label_counts: torch.Tensor, )
src/client/fedrod.py:13
↓ 1 callers
Method
build
(self, features: list[torch.Tensor], targets: list[torch.Tensor])
src/client/knnper.py:100
↓ 1 callers
Function
build_json_format
(celebrities, targets)
data/celeba/preprocess/metadata_to_json.py:74
↓ 1 callers
Method
calculate_grad_mean
(self)
src/server/fediir.py:38
↓ 1 callers
Method
calculate_noise_multiplier
Calculate noise multiplier for given privacy parameters. Args: sample_rate: Sampling rate (batch_size / dataset_size)
src/utils/dp_manager.py:195
↓ 1 callers
Method
calibrate_classifier
(self)
src/server/ccvr.py:100
↓ 1 callers
Function
class_from_string
Dynamically loads a class from a string representation. Args: class_string (str): The string representation of the class, including th
data/utils/process.py:556
↓ 1 callers
Method
classify_features_with_lda
Classifies features using a linear discriminant analysis (LDA) approach with adjustable beta for local and global statistics. Args:
src/client/pfedfda.py:317
↓ 1 callers
Method
classify_with_lda
Performs Linear Discriminant Analysis (LDA) classification. This method classifies input data using LDA by computing the coefficients
src/client/pfedfda.py:365
↓ 1 callers
Method
cluster_clients
(self, similarities)
src/server/cfl.py:84
↓ 1 callers
Method
compute_beta_values
Solves for beta values used in the model. This function computes the beta means and covariance based on the provided features and lab
src/client/pfedfda.py:109
↓ 1 callers
Method
compute_classes_mean_cov
(self)
src/server/ccvr.py:31
↓ 1 callers
Method
compute_consensus
( self, batches_scores: list[torch.Tensor] )
src/server/fedmd.py:124
↓ 1 callers
Method
compute_distance
(self, tensor1, tensor2, metric)
src/server/fedgen.py:213
↓ 1 callers
Method
compute_features
Computes features and collect labels from the provided dataloader. Args: dataloader (DataLoader): A DataLoader containing the inp
src/client/pfedfda.py:285
↓ 1 callers
Function
compute_max_diff_norm
(model_params_diff: list[list[torch.Tensor]])
src/server/cfl.py:118
↓ 1 callers
Function
compute_mean_diff_norm
(model_params_diff: list[list[torch.Tensor]])
src/server/cfl.py:136
↓ 1 callers
Method
compute_pairwise_similarity
(self)
src/server/cfl.py:73
↓ 1 callers
Method
decode
(self, z)
src/server/fedfed.py:309
↓ 1 callers
Method
digest
(self)
src/client/fedmd.py:26
↓ 1 callers
Function
dirichlet
Partition the dataset according to the Dirichlet distribution using a specified concentration parameter, `alpha`. Args: targets (
data/utils/schemes/dirichlet.py:7
↓ 1 callers
Method
evaluate
Evaluating server model. Args: model: Used model. Defaults to None, which will fallback to `self.model`. Returns:
src/server/fedavg.py:590
↓ 1 callers
Function
exclude_domain
( client_num: int, targets: np.ndarray, domain_map: dict[str, int], domain_indices_bound:
data/utils/process.py:489
↓ 1 callers
Method
extract_stats
(self)
src/client/fedpac.py:38
↓ 1 callers
Method
feature_distill
Train VAE, generate shared data, distribute shared data.
src/server/fedfed.py:74
↓ 1 callers
Method
finetune
Client model finetuning. This function will only be activated in `test()`
src/client/fedavg.py:318
↓ 1 callers
Method
fit
(self)
src/client/metafed.py:79
↓ 1 callers
Method
fit
(self)
src/client/fedavg.py:205
↓ 1 callers
Function
flower_partition
( targets: np.ndarray, target_indices: np.ndarray, label_set: set, client_num: int, flower
data/utils/schemes/flower.py:10
↓ 1 callers
Method
generate_client_index
(self)
src/server/adcol.py:151
↓ 1 callers
Function
generate_synthetic_data
(args, partition: dict, stats: dict)
data/utils/process.py:408
↓ 1 callers
Method
generate_virtual_representation
( self, classes_mean: list[torch.Tensor], classes_cov: list[torch.Tensor] )
src/server/ccvr.py:73
↓ 1 callers
Method
generate_weight_matrix
( self, bnmlist: list[torch.Tensor], bnvlist: list[torch.Tensor] )
src/server/fedap.py:160
↓ 1 callers
Function
get_celebrities_and_images
(identities)
data/celeba/preprocess/metadata_to_json.py:22
↓ 1 callers
Function
get_celebrities_and_target
(celebrities, attributes, attribute_name=TARGET_NAME)
data/celeba/preprocess/metadata_to_json.py:47
↓ 1 callers
Method
get_client_model_params
This function is for outputting model parameters that asked by `client_id`. Args: client_id (int): The ID of query client
src/server/fedavg.py:640
↓ 1 callers
Method
get_clients_data_indices
Gets a list of client data indices. Load and return the client-side data index from the partition file for the specified dataset. Ra
src/server/fedavg.py:323
↓ 1 callers
Method
get_data_batch
(self)
src/client/scaffold.py:74
↓ 1 callers
Method
get_dataset
Load the specified dataset according to the configuration. Returns: BaseDataset: This is the loaded dataset instance, which i
src/server/fedavg.py:349
↓ 1 callers
Method
get_dataset_transforms
Define data preprocessing schemes. These schemes will work for every client. Consider to overwrite this function for your unique data
src/server/fedavg.py:364
↓ 1 callers
Method
get_dp_config_for_client
Get DP configuration to send to clients with calculated sample_rate and noise_multiplier.
src/utils/dp_manager.py:101
↓ 1 callers
Method
get_fim_trace_sum
(self)
src/client/fedas.py:17
↓ 1 callers
Method
get_form
(self)
src/server/fedap.py:146
↓ 1 callers
Method
get_knn_logits
(self, features: torch.Tensor)
src/client/knnper.py:72
↓ 1 callers
Method
get_label_weights
(self, clients_label_counts)
src/server/fedgen.py:133
↓ 1 callers
Function
get_metadata
()
data/celeba/preprocess/metadata_to_json.py:8
↓ 1 callers
Method
get_scores
(self, client_id)
src/server/fedmd.py:104
↓ 1 callers
Method
getmean
(self)
src/server/fedap.py:237
↓ 1 callers
Method
getvar
(self)
src/server/fedap.py:240
↓ 1 callers
Function
iid_partition
Partitions the dataset into IID (Independent and Identically Distributed) segments for each client. Args: targets (np.ndarray): A
data/utils/schemes/iid.py:8
↓ 1 callers
Method
increment_round
Increment round counter after each training round.
src/utils/dp_manager.py:157
↓ 1 callers
Function
initialize_data_loaders
Initialize data loaders for training, validation, and testing. Args: dataset: The dataset to be used for creating subsets. data_i
src/utils/functional.py:221
↓ 1 callers
Function
load_data
(name)
data/leaf_utils/stats.py:26
↓ 1 callers
Method
load_data_indices
(self)
src/client/metafed.py:24
↓ 1 callers
Method
load_data_indices
This function is for loading data indices for No.`self.client_id` client.
src/client/fedavg.py:78
↓ 1 callers
Method
load_data_indices
(self)
src/client/fedfomo.py:24
↓ 1 callers
Method
load_data_indices
(self)
src/client/fedap.py:15
↓ 1 callers
Method
load_data_indices
(self)
src/client/fedala.py:23
↓ 1 callers
Method
load_public_data_batches
(self)
src/server/fedmd.py:92
↓ 1 callers
Function
main
(args)
generate_data.py:36
↓ 1 callers
Function
main
(config: DictConfig)
main.py:19
↓ 1 callers
Function
main
()
data/celeba/preprocess/metadata_to_json.py:101
↓ 1 callers
Method
mixup_data
(self, x: torch.Tensor, y: torch.Tensor)
src/client/fedfed.py:198
↓ 1 callers
Method
need_all_features
(self)
src/utils/models.py:239
↓ 1 callers
Method
package
(self)
src/client/metafed.py:74
↓ 1 callers
Method
package
(self)
src/client/scaffold.py:49
↓ 1 callers
Method
package
(self)
src/client/fedproto.py:46
↓ 1 callers
Method
package
Package data that client needs to transmit to the server. You can override this function and add more parameters. Returns:
src/client/fedavg.py:161
↓ 1 callers
Method
package
(self, client_id: int)
src/server/moon.py:26
↓ 1 callers
Function
pairwise
(sequence)
src/server/fedpac.py:159
↓ 1 callers
Function
pairwise_kl_div
Calculate pairwise KL divergence between two sets of distributions.
data/utils/schemes/semantic.py:47
↓ 1 callers
Function
partitioner_class_from_flwr_datasets
Dynamically loads a partitioner class from a string representation of a flwr.datasets.Dataset. Args: flower_partitioner_class (st
data/utils/process.py:573
↓ 1 callers
Method
prepare_model_for_dp
Prepare and convert model for DP training. Returns DP-compatible model.
src/utils/dp_manager.py:82
↓ 1 callers
Function
print_dataset_stats
(name)
data/leaf_utils/stats.py:49
↓ 1 callers
Function
process_celeba
(args, partition: dict, stats: dict)
data/utils/process.py:232
↓ 1 callers
Method
process_features
(self, features: torch.Tensor, y: torch.Tensor)
src/client/fedproto.py:79
↓ 1 callers
Function
process_femnist
(args, partition: dict, stats: dict)
data/utils/process.py:93
↓ 1 callers
Function
project_clients
(client_packages, endpoints, return_diff)
src/server/floco.py:128
↓ 1 callers
Function
prune_args
(args: Namespace)
data/utils/process.py:17
↓ 1 callers
Function
randomly_assign_classes
Partition data to ensure each client has a nearly equal distribution of classes. Args: targets (np.ndarray): Array of data labels
data/utils/schemes/randomly_assign_classes.py:8
↓ 1 callers
Function
relabel_class
Maps hexadecimal class value (string) to a decimal number. returns: - 0 through 9 for classes representing respective numbers - 10 throug
data/femnist/preprocess/data_to_json.py:20
↓ 1 callers
Method
reparameterize
(self, mu: torch.Tensor, logvar: torch.Tensor)
src/server/fedfed.py:301
↓ 1 callers
Method
run_experiment
The entrypoint of FL-bench experiment.
src/server/fedavg.py:928
↓ 1 callers
Method
save_learning_curve_plot
Save the learning curves of FL-bench experiment.
src/server/fedavg.py:873
↓ 1 callers
Method
save_metrics_stats
Save the metrics stats of FL-bench experiment.
src/server/fedavg.py:902
↓ 1 callers
Method
save_model_weights
(self)
src/server/fedavg.py:862
↓ 1 callers
Function
semantic_partition
Partition the dataset semantically using embeddings from a trained EfficientNet. Args: dataset (Dataset): The input dataset.
data/utils/schemes/semantic.py:74
↓ 1 callers
Method
set_lda_weights
Set the LDA weights for the model classifier. This function computes the coefficients and intercepts for the linear discriminant analysis (LD
src/client/pfedfda.py:413
↓ 1 callers
Method
set_logger
Inject server-side logger and output initialization message.
src/utils/dp_manager.py:52
↓ 1 callers
Method
set_parameters
(self, package: dict[str, Any])
src/client/scaffold.py:18
↓ 1 callers
Method
set_parameters
(self, package: dict[str, Any])
src/client/fedproto.py:24
↓ 1 callers
Method
set_parameters
(self, package: dict[str, Any])
src/client/fedmd.py:15
↓ 1 callers
Method
set_parameters
(self, package: dict[str, Any])
src/client/fedap.py:24
↓ 1 callers
Method
set_parameters
(self, package: dict[str, Any])
src/client/fediir.py:15
↓ 1 callers
Method
show_max_metrics
Show the maximum stats that FL method get.
src/server/fedavg.py:792
↓ 1 callers
Function
softmax
(x)
data/utils/process.py:409
↓ 1 callers
Method
test_client_models
The function for testing FL method's output (a single global model or personalized client models).
src/server/fedavg.py:532
↓ 1 callers
Method
test_global_model
The function for testing FL method's output (a single global model or personalized client models).
src/server/fedavg.py:562
← previous
next →
101–200 of 580, ranked by callers