观察者模式

关于观察者模式,目前接触到的最直接最明显的,就是项目中用到的前端消息通讯了吧,偷个懒:点击打开链接

这是之前自己写的前端通讯。原理就是使用委托+观察者,当有对象注册为观察者时,他还需要遵循主题的结构,传入自己在收到消息时,希望得到的数据。

只要观察者加入主题的队列。主题就会通过委托,在触发消息的一瞬间,先把观察者需要的数据填充好,然后向所有关注这条消息的观察者发送消息。

这样做最大的好处,就是主题根本不关注观察者的具体信息,他只需要在触发时,告诉事件对应的所有观察者就好了。这样就只是一对多的关系,避免了多对多的关系网,这不就遵循了最少知识原则吗。

Multi-objective evolutionary federated learning (MEFL) is a machine learning approach that combines the principles of multi-objective optimization and federated learning. Multi-objective optimization is a technique that aims to optimize multiple objectives simultaneously, while federated learning is a decentralized machine learning approach that allows multiple devices to train a model collaboratively without sharing their data. MEFL is designed to overcome the limitations of traditional federated learning approaches, which often suffer from issues related to privacy, communication, and scalability. By using multi-objective optimization, MEFL can optimize the performance of the federated learning algorithm while also addressing these issues. MEFL works by dividing the optimization problem into multiple objectives, such as minimizing the loss function, reducing communication costs, and preserving privacy. A genetic algorithm is then used to optimize these objectives simultaneously, producing a set of Pareto-optimal solutions that represent the trade-offs between the different objectives. These Pareto-optimal solutions can then be used to select the best model for deployment, depending on the specific requirements of the application. MEFL has been shown to be effective in a wide range of applications, including image classification, natural language processing, and speech recognition. Overall, MEFL represents a promising approach to federated learning that can improve the privacy, communication, and scalability of the algorithm while also optimizing its performance.
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值