TsingZ0 / PFLlib

37 traditional FL (tFL) or personalized FL (pFL) algorithms, 3 scenarios, and 20 datasets.
GNU General Public License v2.0
1.36k stars 285 forks source link

FedProto #125

Closed bowuhub closed 10 months ago

bowuhub commented 11 months ago

clientproto.py,test_metrics中为什么 output = float('inf') * torch.ones(y.shape[0], self.num_classes).to(self.device)。 初始化为inf会造成auc计算异常(不到二成,二acc有九成)

TsingZ0 commented 11 months ago

跟据FedProto原文,它采用prototype-based model inference,也就是取距离最小的为对应的class。我们这里,output 是用于计算距离的,理应初始化为inf。

你描述的“初始化为inf会造成auc计算异常(不到二成,二acc有九成)”,我没看懂,能否提供更多细节?