Tutorial

Get Started

You can modify the experimental settings in /config.py as needed, and then run /main.py to start your work with OpenFGL.

Scenario and Dataset Simulation Settings

--scenario           # fgl scenario
--root               # root directory for datasets
--dataset            # list of used dataset(s)
--simulation_mode    # strategy for extracting FGL dataset from global dataset
--processing         # data preprocessing
scenario:

“graph_fl”, “subgraph_fl”

simulation_mode:

scenario=subgraph_fl: “subgraph_fl_label_skew”, “subgraph_fl_louvain_plus”, “subgraph_fl_metis_plus”, “subgraph_fl_louvain”, “subgraph_fl_metis”

scenario=graph_fl: “graph_fl_cross_domain”, “graph_fl_label_dirichlet”, “graph_fl_topology_skew”, “graph_fl_feature_skew”

processing:

“raw”, “random_feature_sparsity”, “random_feature_noise”, “random_edge_sparsity”, “random_edge_noise”, “random_label_sparsity”, “random_label_noise”

Communication Settings

--num_clients        # number of clients
--num_rounds         # number of communication rounds
--client_frac        # client activation fraction

FL/FGL Algorithm Settings

--fl_algorithm       # used fl/fgl algorithm
fl_algorithm:

choices: “isolate”, “fedavg”, “fedprox”, “scaffold”, “moon”, “feddc”, “fedproto”, “fedtgp”, “fedpub”, “fedstar”, “fedgta”, “fedtad”, “gcfl_plus”, “fedsage_plus”, “adafgl”, “feddep”, “fggp”, “fgssl”, “fedgl”

Model and Task Settings

--task               # downstream task
--train_val_test     # train/validatoin/test split proportion
--num_epochs         # number of local epochs
--dropout            # dropout
--lr                 # learning rate
--optim              # optimizer
--weight_decay       # weight decay
--model              # gnn backbone
--hid_dim            # number of hidden layer units
task:

scenario=graph_fl: “graph_cls”, “graph_reg”

scenario=subgraph_fl: “node_cls”, “link_pred”, “node_clust”

Evaluation Settings

--metrics            # performance evaluation metric
--evaluation_mode    # personalized evaluation / global evaluation
metrics:

choices: “accuracy”, “precision”, “f1”, “recall”, “auc”, “ap”, “clustering_accuracy”, “nmi”, “ari”

evaluation_mode:

choices: “global_model_on_local_data”, “global_model_on_global_data”, “local_model_on_local_data”, “local_model_on_global_data”

Privacy Settings

--dp_mech            # differential privacy mechanism
--dp_eps             # differential privacy epsilon
--dp_delta           # differential privacy delta
--grad_clip          # gradient clip max_norm