Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Code missing #1

Open
MukundPatel13 opened this issue Jun 9, 2023 · 4 comments
Open

Code missing #1

MukundPatel13 opened this issue Jun 9, 2023 · 4 comments

Comments

@MukundPatel13
Copy link

Code is missing for generating the different graph show in the published arcticle "Communication-efficient federated continual learning for distributed learning system with Non-IID data".
I would highly appreciate if this can be added to the library. Also please add instructions for how to run the code and in which order

@zhangzhao156
Copy link
Owner

Most of the graphs in the paper are ploted by Origin (a softsware) not matplotlib. You can save the runing results of the python files and then plot them in Origin.
You can just run main_minist_*.py, fedsi and cfedsi are the proposed methods in the paper, fedprox, fedewc and fedavg are the compared methods.

@MukundPatel13
Copy link
Author

Thanks for coming back. Please advise how can I do it using matplotlib only. Also I have other question I ran cfedsi with IID data and changing no other parameter in the program the final result after 50 iterations I got :
Test set: Average loss: 0.0457
Accuracy: 7579/10000 75.79
Testing accuracy: 75.79
While in the paper you mentioned that CfedSI has accuracy of 94.91 for MNIST dataset. PLease advise the required parameter change for each run .

@zhangzhao156
Copy link
Owner

You can save the experimental results as the logging files, and then use matplotlib to write the graphs based on the results in the logging file, e.g., nohup python main_mnist_cfedsi.py > ./iid_mnist_cfedsi.log 2>&1 &
def read_log(filename):
test_loss = []
test_acc = []
with open(filename,'r') as file_to_read:
while True:
lines = file_to_read.readline()
if not lines:
break
item = [i for i in lines.split()]
if (len(item) == 5) and (item[0]=='Test'):
test_loss.append(float(item[4]))
return test_loss

You can tune the parameters of training setttings to imporve the performances, e.g., lamda, rho, s, learning rate.

@MukundPatel13
Copy link
Author

could you please add the fashion Mnist program for FedAvg , Cfedsi. I tried changing the code but its not working for me

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants