prayforhanluo / ctr_algorithm Goto Github PK
View Code? Open in Web Editor NEW一些经典的CTR算法的复现; LR, FM, FFM, AFM, DeepFM, xDeepFM, PNN, DCN, DCNv2, DIFM, AutoInt, FiBiNet,AFN,ONN,DIN, DIEN ... (pytorch, tf2.0)
一些经典的CTR算法的复现; LR, FM, FFM, AFM, DeepFM, xDeepFM, PNN, DCN, DCNv2, DIFM, AutoInt, FiBiNet,AFN,ONN,DIN, DIEN ... (pytorch, tf2.0)
大佬您好,最近看您的DIN代码,有一些地方不太明白,希望得到您的解答!
1、mask = (behaviors_x > 0).float().unsqueeze(-1) 这里的msak的具体作用是啥啊?为什么需要这个mask呢?
这里的 注意力输入部分,原始的好像没有queries - user_behavior吧?为啥有这一项呢
2、attn_input = torch.cat([queries, user_behavior,
queries - user_behavior,
queries * user_behavior], dim = -1)
3、 output = user_behavior.mul(attns.mul(mask)) # batch * seq_len * embed_dim
这个里面为啥还有mask呢?
DeepFM中的编码是采用的one-hot编码方式,作者在此处用了lable编码方式。这种编码方式很少用,且局限性很强。这种编码方式确实在embedding的时候非常方便。但是这种编码方式最后产生的实际效果是不是可信度不强呢
你好,我在阅读DIEN的PyTorch代码时发现一个地方可能存在错误
在Interest Extractor Layer中,GRU的隐藏层应该保留前T-1个用于计算辅助loss
但是DIEN代码的152行是
gru_embed=pad_interests[:,1:]
这样是不是取了后T-1个hidden state?
我理解的应该是
gru_embed=pad_interests[:,:-1]
大佬您好,最近看您的DIN代码,有一些地方不太明白,希望得到您的解答!
1、mask = (behaviors_x > 0).float().unsqueeze(-1) 这里的msak的具体作用是啥啊?为什么需要这个mask呢?
这里的 注意力输入部分,原始的好像没有queries - user_behavior吧?为啥有这一项呢
2、attn_input = torch.cat([queries, user_behavior,
queries - user_behavior,
queries * user_behavior], dim = -1)
3、 output = user_behavior.mul(attns.mul(mask)) # batch * seq_len * embed_dim
这个里面为啥还有mask呢?
大佬,请问一下模型中对输入加上一个offset 有什么作用呢,为啥offset还要向右偏移了一位呢?初次学习,还请大佬指教,感谢!
大佬,您好,您写的这个项目是我看到最优美的推荐代码,对于小白的我,非常受益,感谢您把您的工作分享出来,供大家学习。在阅读代码的时候,我一直有一个小小的疑惑,就是,fields = data_x.max().values,这句话的意思是获取到每列特征中最大的索引,比如第一列是0,1两个不同的特征,而这句代码直接就取到了1,然而实际就有两个不同的特征,这样做embedding的时候,每一列的特征都少一个,所以torch.nn.Embedding(sum(feature_fields)+1,1)是不是应该为torch.nn.Embedding(sum(feature_fields+1),1)?还有为什么要在sum(feature_fields)后面加个1呢?还请大佬明示,感谢!
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.