FedML-AI/FedML

FedGraphnn -- wandb utilization

pleonidou opened this issue · 2 comments

Hi, I would like to ask if there is an option to use the fedgraphnn examples with ego networks for node classification without the wandb?

I would like to store the results per client and server aggregation locally.

I am referring to this example: https://github.com/FedML-AI/FedML/tree/master/python/examples/federate/prebuilt_jobs/fedgraphnn/ego_networks_node_clf

Hello @pleonidou thank you for reaching out. You can store any custom results you need either at the aggregator or the client side, by extending the following functions:

Aggregator: https://github.com/FedML-AI/FedML/blob/master/python/examples/federate/prebuilt_jobs/fedgraphnn/ego_networks_node_clf/trainer/federated_nc_aggregator.py#L25

The test_all() function in the aggregator is executed at the end of every federation round.

Client: https://github.com/FedML-AI/FedML/blob/master/python/examples/federate/prebuilt_jobs/fedgraphnn/ego_networks_node_clf/trainer/federated_nc_trainer.py#L22

The train() function at the client is executed at the beginning of the federation round and the test() function at the end of local training.

For overriding the wandb functionality you can refer to this line here: https://github.com/FedML-AI/FedML/blob/master/python/examples/federate/prebuilt_jobs/fedgraphnn/ego_networks_node_clf/trainer/federated_nc_aggregator.py#L43

In general, you can also use the fedml.log() functionality to record your custom metrics, but by extending the functionality as described above in both the aggregator and the client class you have more control on what is being recorded.