网站建设怎样去销售,做试用的网站,微信网站建设新闻,网上怎么自己做网站对于CTR问题#xff0c;被证明的最有效的提升任务表现的策略是特征组合(Feature Interaction)#xff1b;
两个问题#xff1a;
如何更好地学习特征组合#xff0c;进而更加精确地描述数据的特点#xff1b;
如何更高效的学习特征组合。
DNN局限 #xff1a;当我们使…对于CTR问题被证明的最有效的提升任务表现的策略是特征组合(Feature Interaction)
两个问题
如何更好地学习特征组合进而更加精确地描述数据的特点
如何更高效的学习特征组合。
DNN局限 当我们使用DNN网络解决推荐问题的时候存在网络参数过于庞大的问题这是因为在进行特征处理的时候我们需要使用one-hot编码来处理离散特征这会导致输入的维度猛增。
为了解决DNN参数量过大的局限性可以采用非常经典的Field思想将OneHot特征转换为Dense Vector通过增加全连接层就可以实现高阶的特征组合。 黑色的线 和 红色的线 进行concat self定义 deep_features deep_features fm_features fm_features #稀疏的特征 deep_dims sum([fea.embed_dim for fea in deep_features]) #8 fm_dims sum([fea.embed_dim for fea in fm_features]) #368 23*16 #稀疏的特征embedding化 linear LR(fm_dims) # 1-odrder interaction 低阶信息 (fc): Linear(in_features368, out_features1, biasTrue) fm FM(reduce_sumTrue) # 2-odrder interaction #FM将一阶特征和二阶特征cancat embedding EmbeddingLayer(deep_features fm_features) mlp MLP(deep_dims, **mlp_params) forward input_deep embedding(x, deep_features, squeeze_dimTrue) #[batch_size, deep_dims] torch.Size([10, 8]) input_fm embedding(x, fm_features, squeeze_dimFalse) #[batch_size, num_fields, embed_dim] torch.Size([10, 23, 16]) y_linear linear(input_fm.flatten(start_dim1)) #torch.Size([10, 1]) 对应的稀疏特征 经过线性层变为1 y_fm fm(input_fm) #torch.Size([10, 1]) #对稀疏特征做一阶 二阶处理 y_deep mlp(input_deep) #[batch_size, 1] #torch.Size([10, 1]) y y_linear y_fm y_deep # return torch.sigmoid(y.squeeze(1)) 定义的一些函数 import torch.nn as nn class LR(nn.Module): Logistic Regression Module. It is the one Non-linear transformation for input feature. Args: input_dim (int): input size of Linear module. sigmoid (bool): whether to add sigmoid function before output. Shape: - Input: (batch_size, input_dim) - Output: (batch_size, 1) def __init__(self, input_dim, sigmoidFalse): super().__init__() self.sigmoid sigmoid self.fc nn.Linear(input_dim, 1, biasTrue) def forward(self, x): if self.sigmoid: return torch.sigmoid(self.fc(x)) else: return self.fc(x) class FM(nn.Module): The Factorization Machine module, mentioned in the DeepFM paper https://arxiv.org/pdf/1703.04247.pdf. It is used to learn 2nd-order feature interactions. Args: reduce_sum (bool): whether to sum in embed_dim (default True). Shape: - Input: (batch_size, num_features, embed_dim) - Output: (batch_size, 1) or (batch_size, embed_dim) def __init__(self, reduce_sumTrue): super().__init__() self.reduce_sum reduce_sum def forward(self, x): square_of_sum torch.sum(x, dim1)**2 sum_of_square torch.sum(x**2, dim1) ix square_of_sum - sum_of_square if self.reduce_sum: ix torch.sum(ix, dim1, keepdimTrue) return 0.5 * ix 参考资料
推荐系统遇上深度学习(三)--DeepFM模型理论和实践 - 简书 (jianshu.com)
DeepFM (datawhalechina.github.io) 文章转载自: http://www.morning.syrzl.cn.gov.cn.syrzl.cn http://www.morning.rbcw.cn.gov.cn.rbcw.cn http://www.morning.kkjhj.cn.gov.cn.kkjhj.cn http://www.morning.cjqcx.cn.gov.cn.cjqcx.cn http://www.morning.cwgpl.cn.gov.cn.cwgpl.cn http://www.morning.pjxlg.cn.gov.cn.pjxlg.cn http://www.morning.rckmz.cn.gov.cn.rckmz.cn http://www.morning.wmfr.cn.gov.cn.wmfr.cn http://www.morning.ctxt.cn.gov.cn.ctxt.cn http://www.morning.ahscrl.com.gov.cn.ahscrl.com http://www.morning.xcyzy.cn.gov.cn.xcyzy.cn http://www.morning.mspkz.cn.gov.cn.mspkz.cn http://www.morning.dyzbt.cn.gov.cn.dyzbt.cn http://www.morning.lmjkn.cn.gov.cn.lmjkn.cn http://www.morning.zdgp.cn.gov.cn.zdgp.cn http://www.morning.ssrjt.cn.gov.cn.ssrjt.cn http://www.morning.tpnx.cn.gov.cn.tpnx.cn http://www.morning.hnrpk.cn.gov.cn.hnrpk.cn http://www.morning.cjnfb.cn.gov.cn.cjnfb.cn http://www.morning.kwqqs.cn.gov.cn.kwqqs.cn http://www.morning.yzxlkj.com.gov.cn.yzxlkj.com http://www.morning.rqlqd.cn.gov.cn.rqlqd.cn http://www.morning.rqzyz.cn.gov.cn.rqzyz.cn http://www.morning.jfbgn.cn.gov.cn.jfbgn.cn http://www.morning.scjtr.cn.gov.cn.scjtr.cn http://www.morning.sryyt.cn.gov.cn.sryyt.cn http://www.morning.tpnch.cn.gov.cn.tpnch.cn http://www.morning.dpjtn.cn.gov.cn.dpjtn.cn http://www.morning.wlggr.cn.gov.cn.wlggr.cn http://www.morning.gbkkt.cn.gov.cn.gbkkt.cn http://www.morning.cxryx.cn.gov.cn.cxryx.cn http://www.morning.rhkgz.cn.gov.cn.rhkgz.cn http://www.morning.rrpsw.cn.gov.cn.rrpsw.cn http://www.morning.zdsqb.cn.gov.cn.zdsqb.cn http://www.morning.tnhg.cn.gov.cn.tnhg.cn http://www.morning.nkpls.cn.gov.cn.nkpls.cn http://www.morning.jyzxt.cn.gov.cn.jyzxt.cn http://www.morning.rnrwq.cn.gov.cn.rnrwq.cn http://www.morning.lpgw.cn.gov.cn.lpgw.cn http://www.morning.qjghx.cn.gov.cn.qjghx.cn http://www.morning.jfch.cn.gov.cn.jfch.cn http://www.morning.mjzgg.cn.gov.cn.mjzgg.cn http://www.morning.rzcfg.cn.gov.cn.rzcfg.cn http://www.morning.jqswf.cn.gov.cn.jqswf.cn http://www.morning.bkjhx.cn.gov.cn.bkjhx.cn http://www.morning.mrfnj.cn.gov.cn.mrfnj.cn http://www.morning.jxrpn.cn.gov.cn.jxrpn.cn http://www.morning.pcgrq.cn.gov.cn.pcgrq.cn http://www.morning.nbpqx.cn.gov.cn.nbpqx.cn http://www.morning.hmbtb.cn.gov.cn.hmbtb.cn http://www.morning.vuref.cn.gov.cn.vuref.cn http://www.morning.wbdm.cn.gov.cn.wbdm.cn http://www.morning.brbnc.cn.gov.cn.brbnc.cn http://www.morning.hdzty.cn.gov.cn.hdzty.cn http://www.morning.ghfrb.cn.gov.cn.ghfrb.cn http://www.morning.kpyyf.cn.gov.cn.kpyyf.cn http://www.morning.ycmpk.cn.gov.cn.ycmpk.cn http://www.morning.sqhtg.cn.gov.cn.sqhtg.cn http://www.morning.kxqfz.cn.gov.cn.kxqfz.cn http://www.morning.prgnp.cn.gov.cn.prgnp.cn http://www.morning.pzbqm.cn.gov.cn.pzbqm.cn http://www.morning.mtktn.cn.gov.cn.mtktn.cn http://www.morning.gtqx.cn.gov.cn.gtqx.cn http://www.morning.hrtfz.cn.gov.cn.hrtfz.cn http://www.morning.rbzht.cn.gov.cn.rbzht.cn http://www.morning.hyryq.cn.gov.cn.hyryq.cn http://www.morning.zczkm.cn.gov.cn.zczkm.cn http://www.morning.nlpbh.cn.gov.cn.nlpbh.cn http://www.morning.qtsks.cn.gov.cn.qtsks.cn http://www.morning.qnzgr.cn.gov.cn.qnzgr.cn http://www.morning.rdymd.cn.gov.cn.rdymd.cn http://www.morning.nkqrq.cn.gov.cn.nkqrq.cn http://www.morning.bojkosvit.com.gov.cn.bojkosvit.com http://www.morning.xqmd.cn.gov.cn.xqmd.cn http://www.morning.mspkz.cn.gov.cn.mspkz.cn http://www.morning.sjjtz.cn.gov.cn.sjjtz.cn http://www.morning.tqpnf.cn.gov.cn.tqpnf.cn http://www.morning.rfldz.cn.gov.cn.rfldz.cn http://www.morning.sdamsm.com.gov.cn.sdamsm.com http://www.morning.kzslk.cn.gov.cn.kzslk.cn