Closed wolaiye1010 closed 1 year ago
不太明白你说的是什么问题,shareExpert的输入不就应该是上一层所有shared expert以及specific expert的输出吗
@easezyc , 我描述有问题,实际的问题点就是我红线画的,第一层的每个specificExpert的输出,应该只输入到相应的下一层的specific task,share expert的输出到share expert,但现在的实现变成了我红线所画的流程。
@easezyc ,我可以改下,发个pr你看下
感觉是你理解错了,红线才是对的,你看这个代码,也是这种实现,不过他只有一层 https://github.com/huangjunheng/recommendation_model/blob/master/mmoe_model/PLE.py
@wolaiye1010 It is worth noting that the selected matrix of the shared module in PLE is slightly different from task-specific modules, as it consists of all shared experts and task-specific experts in this layer. 论文原文,红线才是对的
@easezyc ,"It is worth noting that the selected matrix of the shared module in PLE is slightly different from task-specific modules, as it consists of all shared experts and task-specific experts in this layer." 这句话的意思不是红线相连,而是shareExpert 的输出是由shareExpert 的gate混合 上一层 所有taskSpecific +expert的输出
@easezyc , 可以看下这个 高star的tf的开源实现 https://github.com/shenweichen/DeepCTR/blob/master/deepctr/models/multitask/ple.py 是没有红线部分的,每个task的输入就是上一层的混合后 的task的输出,而且论文里的结构图片也是这么画的
感觉是你理解错了,红线才是对的,你看这个代码,也是这种实现,不过他只有一层 https://github.com/huangjunheng/recommendation_model/blob/master/mmoe_model/PLE.py
这个代码只实现了单层的cgc 网络,没有实现后面的层。
@wolaiye1010 我get了我的代码的问题在哪了,你的commit我已经merge进去了,感谢你的贡献
@easezyc , 已测试没有问题,pull request里有test方法
@wolaiye1010
也再麻烦你确认一下你提交的代码是否能跑通我给的这几个数据集(我最近没什么时间来测试),看看这个表格里的实验结果(3次重复实验)是否需要更正一下,再次感谢你的贡献
上面这一行代码会导致,shareExpert 的输入是上一层的task的输出,第一层的时候没有问题,第二层就会有问题,如下图红线所示。