FLgo学习

https://github.com/WwZzz/easyFL

安装:pip install flgo numba

作者:https://zhuanlan.zhihu.com/p/614218973

quick-start

python 复制代码
import flgo
import flgo.benchmark.mnist_classification as mnist
import flgo.benchmark.partition as fbp
import flgo.algorithm.fedavg as fedavg

# Line 1: Create a typical federated learning task
flgo.gen_task_by_(mnist, fbp.IIDPartitioner(num_clients=5), './my_task')
# Line 2: Running FedAvg on this task
fedavg_runner = flgo.init('./my_task', fedavg, {'gpu': [0,], 'num_rounds':20, 'num_epochs': 1})
# Line 3: Start Training
fedavg_runner.run()

# Show Training Result
import flgo.experiment.analyzer as fea
# Create the analysis plan
analysis_plan = {
    'Selector':{'task': './my_task', 'header':['fedavg',], },
    'Painter':{'Curve':[{'args':{'x':'communication_round', 'y':'val_loss'}}]},
}

fea.show(analysis_plan)

数据异构

  • diversity 类型
  • Dirichlet 分布

讨论两种数据异构类型,对训练准确率的影响

不知道为什么改 num_clients 就会报错,难道只能是100?

有时间再研究下代码

相关推荐
哥布林学者30 分钟前
吴恩达深度学习课程四:计算机视觉 第二周:经典网络结构 (三)1×1卷积与Inception网络
深度学习·ai
丹宇码农2 小时前
Index-TTS2 从零到一:完整安装与核心使用教程
人工智能·ai·tts
undsky_4 小时前
【RuoYi-SpringBoot3-Pro】:接入 AI 对话能力
人工智能·spring boot·后端·ai·ruoyi
HalvmånEver8 小时前
AI 工具实战测评:从技术性能到场景落地的全方位解析
人工智能·ai
私人珍藏库9 小时前
AutoGLM无需豆包手机,让AI自动帮你点外卖-刷视频
android·ai·智能手机·工具·软件·辅助·autoglm
阿杰学AI9 小时前
AI核心知识55——大语言模型之PE工程师(简洁且通俗易懂版)
人工智能·ai·语言模型·prompt·prompt engineer·提示词工程师·pe工程师
Elastic 中国社区官方博客10 小时前
开始使用 Elastic Agent Builder 和 Strands Agents SDK
大数据·人工智能·elasticsearch·搜索引擎·ai·全文检索
源码技术栈11 小时前
智慧工地微服务架构+Java+Spring Cloud +Uni-App +MySql开发,在微信公众号、小程序、H5、移动端
java·ai·saas·智慧工地·智慧工地项目·可视化大屏·智慧工地系统
前端无涯11 小时前
Qoder的使用
前端·ide·ai·qoder
晨启AI12 小时前
ClaudeCode 实战指南(六):Skills 技能包开发与自动化实战
ai·实战·ai编程·skill·claude code