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

感觉这一步计算量好大 #18

Closed
lixusign opened this issue Aug 3, 2020 · 4 comments
Closed

感觉这一步计算量好大 #18

lixusign opened this issue Aug 3, 2020 · 4 comments

Comments

@lixusign
Copy link

lixusign commented Aug 3, 2020

self.l2_loss = tf.nn.l2_loss(self.user_emb_matrix) + tf.nn.l2_loss(
self.entity_emb_matrix) + tf.nn.l2_loss(self.relation_emb_matrix)

请问作者有啥可以优化的办法 或者 替换的办法呢?

比如 我的 emb 大小是 [100000000, 32]

@hwwang55
Copy link
Owner

hwwang55 commented Aug 3, 2020

您好,可以只考虑当前minibatch所涉及的用户,也就是self.user_embeddings。谢谢!

@lixusign
Copy link
Author

lixusign commented Aug 4, 2020

是哦 谢谢 ,要是n_entity 和 n_relation 比较大就没辙了。

@hwwang55
Copy link
Owner

hwwang55 commented Aug 4, 2020

理论上也可以只考虑本minibatch涉及到的entity和relation的

@lixusign
Copy link
Author

lixusign commented Aug 5, 2020

哦哦 我都试试 谢谢小主

@lixusign lixusign closed this as completed Aug 5, 2020
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