QinbinLi / MOON

Model-Contrastive Federated Learning (CVPR 2021)
MIT License
263 stars 56 forks source link

question of compute_accuracy #13

Closed 18811449050 closed 2 years ago

18811449050 commented 2 years ago

I would like to know what this method(compute_accuracy) does? centralized learning?Model warm up?

QinbinLi commented 2 years ago

Hi @18811449050 ,

This method computes the prediction accuracy of the input model on the input dataset. There is no training on the model inside compute_accuracy.

18811449050 commented 2 years ago

If it is a regression task, how to change the loss?

QinbinLi commented 2 years ago

Currently, MOON is designed for the classification task. For regression task, you may need to change the cross-entropy loss (e.g., line 130 of main.py) to loss for regression (e.g., MSELoss). You also need to change the model architecture.