「PyTorch」A deep matching model library for recommendations & advertising. It's easy to train models and to export representation vectors which can be used for ANN search.
Originally posted by xbingsun May 25, 2022
您好,我在mind实现代码中看到调用 input_from_feature_columns 函数得到用户的历史行为的表示,而在该函数中使用了get_varlen_pooling_list对用户的行为进行了pooling操作,想要请问这样做的原因是什么呢?好像原版本的deepmatch中也使用了这个操作,根据原论文胶囊层输入应该是各个items的embeddings(如下图)。
我的电脑是 mac book pro
python=3.7
deepctr-torch=0.2.2
tensorflow-macos 2.8.0
我在 DeepMatch-Torch 的示例里运行了 run_fm_dssm.py 但是没有成功,报错了。 Traceback (most recent call last): File "/Users/henry/PycharmProjects/github/DeepMatch-Torch/examples/run_fm_dssm.py", line 8, in <module> from preprocess import gen_data_set, gen_model_input File "/Users/henry/PycharmProjects/github/DeepMatch-Torch/examples/preprocess.py", line 4, in <module> from tensorflow.python.keras.preprocessing.sequence import pad_sequences ModuleNotFoundError: No module named 'tensorflow.python.keras.preprocessing' WARNING:root: DeepCTR-PyTorch version 0.2.7 detected. Your version is 0.2.2. Use pip install -U deepctr-torch to upgrade.Changelog: https://github.com/shenweichen/DeepCTR-Torch/releases/tag/v0.2.7
提示让我安装 deepctr=0.2.7, 但是好像依赖于 TensorFlow ,安装不上 (py38) henry@hzMacBookPro DeepMatch-Torch % pip3 install deepctr-torch==0.2.7 Looking in indexes: http://mirrors.aliyun.com/pypi/simple/ Collecting deepctr-torch==0.2.7 Using cached http://mirrors.aliyun.com/pypi/packages/d2/17/f392dfbaefdd6371335995c4f84cf3b5166cf907fdfa0aa4edc380fdfc5b/deepctr_torch-0.2.7-py3-none-any.whl (70 kB) Requirement already satisfied: torch>=1.1.0 in /Users/henry/miniforge3/envs/py38/lib/python3.8/site-packages (from deepctr-torch==0.2.7) (1.11.0) ERROR: Could not find a version that satisfies the requirement tensorflow (from deepctr-torch) (from versions: none) ERROR: No matching distribution found for tensorflow
想请问一下该如何解决。
There are two bugs related to the codes for YoutubeDNN model.
The gen_data_set_youteube has a typo... should be youtube. (Not necessarily a bug lol)
Here's the first bug: gen_data_set_youteube will produce the negative samples ONLY, without any positive samples. Consequently all training labels will be 0.
The second one: [neg_list[item_idx] for item_idx in np.random.choice(neg_list, negsample)] is not correct. It should directly call the indexes.