Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

DIN 序列特征 #20

Open
shelson-woo opened this issue Jun 2, 2021 · 3 comments
Open

DIN 序列特征 #20

shelson-woo opened this issue Jun 2, 2021 · 3 comments

Comments

@shelson-woo
Copy link

shelson-woo commented Jun 2, 2021

你好,请问一下,在你构建序列特征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
Copy link
Owner

qiaoguan commented Jun 3, 2021

这个特征没用feature_column

@shelson-woo
Copy link
Author

这个特征没用feature_column

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

@qiaoguan
Copy link
Owner

qiaoguan commented Jun 3, 2021

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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants