DIN

作者: 雨宝_f737 | 来源:发表于2019-03-18 10:28 被阅读0次

用户的兴趣是很多样的,基于候选商品只与用户的一部分兴趣有关,使用attention机制,对用户的不同行为的注意力是不一样的。

数据集问题:

review包含reviewerId(评论人的id),asin(商品ID),unixReviewTime(评论时间)

meta包含asin(商品ID),categories(类别,只包含最后一个类目)

meta_df中是按照asin排序,review_df是按照reviewid,unixreviewtime进行排序,cate_list是所有商品的categories构成的列表

Build_dataset:

每个正样例产生相同个数的负样例;

训练集为前i个item产生下一个item,添加一个正例添加一个负例

最后一个Item是目标

test_set中存储的是(reviewerId, history, (pos, neg))

train_set中存储的是(reviewerId, history, pos)

model:

先使用用户访问过的所有的item的embedding加和组合成用户的embedding表示

损失函数时sigmoid_cross_entropy_with_logits

需要训练的参数包含

<tf.Variable 'user_emb_w:0' shape=(192403, 128) dtype=float32_ref>

<tf.Variable 'item_emb_w:0' shape=(63001, 64) dtype=float32_ref>

 <tf.Variable 'item_b:0' shape=(63001,) dtype=float32_ref>

<tf.Variable 'cate_emb_w:0' shape=(801, 64) dtype=float32_ref>,

<tf.Variable 'batch_normalization/beta:0' shape=(128,) dtype=float32_ref>

<tf.Variable 'batch_normalization/gamma:0' shape=(128,) dtype=float32_ref>

<tf.Variable 'dense/kernel:0' shape=(128, 128) dtype=float32_ref>

<tf.Variable 'dense/bias:0' shape=(128,) dtype=float32_ref>  #将用户访问过的item的embedding压缩到一起

 <tf.Variable 'b1/beta:0' shape=(256,) dtype=float32_ref>

<tf.Variable 'b1/gamma:0' shape=(256,) dtype=float32_ref>

<tf.Variable 'f1/kernel:0' shape=(256, 80) dtype=float32_ref>

<tf.Variable 'f1/bias:0' shape=(80,) dtype=float32_ref>

<tf.Variable 'f2/kernel:0' shape=(80, 40) dtype=float32_ref>

<tf.Variable 'f2/bias:0' shape=(40,) dtype=float32_ref>

<tf.Variable 'f3/kernel:0' shape=(40, 1) dtype=float32_ref>

<tf.Variable 'f3/bias:0' shape=(1,) dtype=float32_ref>

相关文章

网友评论

      本文标题:DIN

      本文链接:https://www.haomeiwen.com/subject/vzqcpqtx.html