qiaoguan / deep-ctr-prediction

CTR prediction models based on deep learning(基于深度学习的广告推荐CTR预估模型)
https://github.com/qiaoguan/deep-ctr-prediction
907 stars 276 forks source link

DIN 序列特征 #20

Open shelson-woo opened 3 years ago

shelson-woo commented 3 years ago

你好,请问一下,在你构建序列特征attention 部分时,看到你写了个din_feature_column.py, 你是想用feature_column 的方法构建序列特征么?但是我看你实现的时候确是下面的代码。
last_click_creativeid = tf.string_to_hash_bucket_fast(features["user_click_creatives_att"], 200000) creativeid_embeddings = tf.get_variable(name="attention_creativeid_embeddings", dtype=tf.float32, shape=[200000, 20]) last_click_creativeid_emb = tf.nn.embedding_lookup(creativeid_embeddings, last_click_creativeid) att_creativeid = tf.string_to_hash_bucket_fast(features["creative_id_att"], 200000) creativeid_emb = tf.nn.embedding_lookup(creativeid_embeddings, att_creativeid)

qiaoguan commented 3 years ago

这个特征没用feature_column

shelson-woo commented 3 years ago

这个特征没用feature_column

你好,你开始的想法是想使用feature_column 去统一实现特征构建方式么?我这边也是想用feature_column 去构建attention部分的,但是实现起来有难度,想看看你这边是否有好从想法?

qiaoguan commented 3 years ago

feature_column用起来是比较方便,但是它只提供了那么几种函数,有些自定义较强的功能就不太好用feature_column实现,另外还有一个可以考量的是feature_column离线/在线的速度