alibaba / FederatedScope

An easy-to-use federated learning platform
https://www.federatedscope.io
Apache License 2.0
1.29k stars 208 forks source link

one bug in federatedscope/gfl/fedsageplus/trainer.py #767

Open blgpb opened 6 months ago

blgpb commented 6 months ago

In the trainer.py, ctx.y_true = batch.num_missing[mask] ctx.y_prob = pred_missing

https://github.com/alibaba/FederatedScope/blob/480b67de851df2fa02b7cc2189f1803d947998d7/federatedscope/gfl/fedsageplus/trainer.py#L42C1-L43C34

https://github.com/alibaba/FederatedScope/blob/480b67de851df2fa02b7cc2189f1803d947998d7/federatedscope/gfl/fedsageplus/trainer.py#L66C1-L67C34

It seems that 'pred_missing' (i.e., the output of the missing neighbor generator) and 'num_missing' (i.e., the groundtruth of missing nodes) are used to compute the final result. However, it is a node classification task. We should compute the node classification accuracy.

As a result, I suggest that the node label and the predicted node label should be used to compute the final result.

It may be changed to ctx.y_true = batch.y[mask] ctx.y_prob = nc_pred