WwZzz / easyFL

An experimental platform for federated learning.
Apache License 2.0
519 stars 88 forks source link

想问下result_analysis.py的参数设置 #32

Closed XinghaiLiao closed 1 year ago

XinghaiLiao commented 1 year ago

我看到有这段代码 _default_option = { 'plot': ['linestyle', 'marker', 'linewidth', 'markersize',], 'scatter': ['s', 'cmap', 'alpha', 'color',], 'group_plot': ['linestyle', 'marker', 'linewidth', 'markersize',], } 请问可以设置参数来group_plot并设置样式嘛

WwZzz commented 1 year ago

你好,我不确定你使用的是哪个版本的。最新版的flgo可以通过输入关键字来设置每个绘制对象的样式,比如: import flgo.experiment.analyzer task = 'my_task' analysis_plan = { 'Selector':{ 'task': task, 'header':['fedavg'] }, 'Painter':{ 'Curve':[ {'args':{'x': 'communication_round', 'y':'test_loss'},'obj_option':{'marker': 'o'}, 'fig_option':{'title':'a test title'}}, ] } } flgo.experiment.analyzer.show(analysis_plan) 其中obj_option设置每一条曲线(或是柱、散点,对应于一个记录record)的样式(例如Curve对象所对应的plot方法中的参数名称作为关键字),fig_option对应图的样式(plt.xxx的xxx为关键字)