Skip to content

Commit

Permalink
fix code tree
Browse files Browse the repository at this point in the history
  • Loading branch information
JinsooKim-KR committed Oct 1, 2023
1 parent 80cfbaf commit 978f000
Show file tree
Hide file tree
Showing 4 changed files with 15 additions and 13 deletions.
4 changes: 2 additions & 2 deletions baselines/FedMeta/FedMeta/utils.py
Original file line number Diff line number Diff line change
Expand Up @@ -121,7 +121,6 @@ def plot_from_pkl(directory="."):
"fedavg_meta.pkl": "blue",
"fedmeta_maml.pkl": "orange",
"fedmeta_meta_sgd.pkl": "red",
# ... 여기에 추가 파일 이름과 색상을 매핑 ...
}

pkl_files = [f for f in os.listdir(directory) if f.endswith('.pkl')]
Expand Down Expand Up @@ -158,5 +157,6 @@ def plot_from_pkl(directory="."):

plt.show()


if __name__ == '__main__':
plot_from_pkl()
plot_from_pkl('./femnist/graph_params')
24 changes: 13 additions & 11 deletions baselines/FedMeta/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -75,44 +75,46 @@ dataset: [FEMNIST, SHAKESPEARE] # list of datasets you include in your baseline
#SHAKESEPEARE dataset Download command for these experiments
./preprocess.sh -s niid --sf 0.16 -k 0 -t sample
````

****Start experiments**** :
```bash
# FedAvg + Femnist Dataset
python main.py algo=fedavg data=femnist path=(your leaf dataset path)/leaf/data/shakespeare/data
# FedAvg(Meta) + Femnist Dataset
python main.py algo=fedavg_meta data=femnist path=(your leaf dataset path)/leaf/data/shakespeare/data
python main.py algo=fedavg_meta data=femnist path=../leaf/data/shakespeare/data
# FedMeta(MAML) + Femnist Dataset
python main.py algo=fedmeta_maml data=femnist path=(your leaf dataset path)/leaf/data/shakespeare/data
python main.py algo=fedmeta_maml data=femnist path=../leaf/data/shakespeare/data
# FedMeta(Meta-SGD) + Femnist Dataset
python main.py algo=fedmeta_meta_sgd data=femnist path=(your leaf dataset path)/leaf/data/shakespeare/data
python main.py algo=fedmeta_meta_sgd data=femnist path=../leaf/data/shakespeare/data
#FedAvg + Shakespeare Dataset
python main.py algo=fedavg data=shakespeare path=(your leaf dataset path)/leaf/data/shakespeare/data
python main.py algo=fedavg data=shakespeare path=../leaf/data/shakespeare/data
#FedAvg(Meta) + Shakespeare Dataset
python main.py algo=fedavg_meta data=shakespeare path=(your leaf dataset path)/leaf/data/shakespeare/data
python main.py algo=fedavg_meta data=shakespeare path=../leaf/data/shakespeare/data
#FedMeta(MAML) + Shakespeare Dataset
python main.py algo=fedmeta_maml data=shakespeare path=(your leaf dataset path)/leaf/data/shakespeare/data
python main.py algo=fedmeta_maml data=shakespeare path=../leaf/data/shakespeare/data
#FedMeta(Meta-SGD) + Shakespeare Dataset
python main.py algo=fedmeta_meta_sgd data=shakespeare path=(your leaf dataset path)/leaf/data/shakespeare/data
python main.py algo=fedmeta_meta_sgd data=shakespeare path=../leaf/data/shakespeare/data
```


## Expected Results
If you proceed with all of the above experiments, You can get a graph of your experiment results as shown below along that `./femnist or shakespeare/graph_params/result_graph.png`.
```bash
#If you want to see the graph, use the command below.
#You can check the graph using the command below.
python
[Now show a figure/table displaying the results of the above command]
# add more commands + plots for additional experiments.
```
![](docs/result_graph.png)
**Femnist dataset experiment results**

**Shakespeare dataset experiment results**
![](docs/shakespeare_result_graph.png)
Binary file removed baselines/FedMeta/docs/result_graph.png
Binary file not shown.
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 978f000

Please sign in to comment.