-
Notifications
You must be signed in to change notification settings - Fork 355
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
[ModelZoo] Support Co_Action Network #344
base: main
Are you sure you want to change the base?
Conversation
modelzoo/CAN/script/calc_ckpt.py
Outdated
shape = variable.get_shape() | ||
variable_parameters = 1 | ||
for dim in shape: | ||
# print(dim) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
去掉无用的print或是注释
modelzoo/CAN/script/data_iterator.py
Outdated
@@ -0,0 +1,228 @@ | |||
import numpy | |||
import json | |||
#import cPickle as pkl |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上
modelzoo/CAN/script/data_iterator.py
Outdated
cat_idx = 0 | ||
self.meta_id_map[mid_idx] = cat_idx | ||
|
||
f_review = open("/home/test/modelzoo/CAN/data/reviews-info", "r") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个路径不要用绝对路径
modelzoo/CAN/script/data_iterator.py
Outdated
self.n_mid = len(self.source_dicts[1]) | ||
self.n_cat = len(self.source_dicts[2]) | ||
self.n_carte = [len(self.source_dicts[3]), len(self.source_dicts[4])] | ||
print("n_uid=%d, n_mid=%d, n_cat=%d" % (self.n_uid, self.n_mid, self.n_cat)) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
多余的print
modelzoo/CAN/script/generate_voc.py
Outdated
@@ -0,0 +1,91 @@ | |||
import pickle as pk | |||
|
|||
f_train = open("/home/test/modelzoo/DIEN/data/local_train_splitByUser", "r") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
同上,不要使用绝对路径
modelzoo/CAN/script/generate_voc.py
Outdated
item_carte_dict = {} | ||
cate_carte_dict = {} | ||
|
||
iddd = 0 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个iddd是有用的变量吗?
import hashlib | ||
import random | ||
|
||
fin = open("/home/test/modelzoo/DIEN/data/jointed-new-split-info", "r") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
绝对路径问题
modelzoo/CAN/script/model.py
Outdated
@@ -0,0 +1,800 @@ | |||
#import tensorflow as tf | |||
import tensorflow.compat.v1 as tf |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个里是开源代码就这么写的吗,为啥不import tensorflow
modelzoo/CAN/script/split_by_user.py
Outdated
@@ -0,0 +1,20 @@ | |||
import random | |||
|
|||
fi = open("/home/test/modelzoo/DIEN/data/local_test", "r") |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
绝对路径问题
scores = tf.where(key_masks, scores, paddings) # [B, 1, T] | ||
|
||
# Scale | ||
# scores = scores / (facts.get_shape().as_list()[-1] ** 0.5) |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
这个是开源代码里就注释掉的吗
modelzoo/CAN/data/README.md
Outdated
## Installation | ||
dependences: | ||
|
||
tensorflow:1.4.1 |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
以deeprec,python3.6为标准来写
|
这是来自QQ邮箱的假期自动回复邮件。你的邮件我已经收到,我会尽快回复你的。
|
dien和can的数据是一样的,只是处理方法不同,这两个模型生成的文件也不一样 |
能否复用DIEN生成的数据文件? 虽然原始数据是一致的,但是处理数据需要花费时间。这部分开销对于测试并不友好,目前DeepRec提供的docker中,是直接提供DIEN处理后的数据文件。如果能够和DIN一样复用的话,能够有效减少测试时处理数据的时间以及减小docker image的大小。 |
DIEN生成的数据文件缺少了两个文件。其它的文件可以复用 |
|
缺少item_carte_voc.pkl和cate_carte_voc.pkl文件,我试一试加上这两个文件的生成脚本。 |
尽量复用。 |
这个prepare_data部分速度太慢了,可以使用多进程处理吗 |
|
||
## Prepare dataset | ||
|
||
Prepare data of DIEN first; |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
CAN
这是来自QQ邮箱的假期自动回复邮件。你的邮件我已经收到,我会尽快回复你的。
|
@@ -0,0 +1,10 @@ | |||
export PATH="~/anaconda4/bin:$PATH" |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
移除本地开发变量
请按照DeepRec最新代码中modelzoo里DIEN的代码,调整代码结构,主要以下几点: |
是需要我按照DIEN的重新写一个CAN模型吗 |
是的,包括其他模型,因为要考虑到和现有测试框架的契合 |
No description provided.