kwonmha / Improving-RNN-recommendation-model

Applied weight tying technique to RNN based recommendation model. Implemented with Tensorflow and Keras.
53 stars 13 forks source link

got an error during the train #1

Closed yang628 closed 6 years ago

yang628 commented 6 years ago

Hello, this project can run? I added the data set to do the preprocessing according to your original usage method and got an error during the train. 中文:您好,这个项目可以运行吗?我按照使用方法加了数据集做了预处理,在train期间出错了。

kwonmha commented 6 years ago

Yes it runs. Did you get error on running preprocess.py or train.py? While running preprocess.py, the possible errors can be like these: Does your data involve rating time? Otherwise it produced error in previous version. So I fixed. Use '--columns uir'. Or you need to match --sep parameter with your data. Is it comma separated? Default is '::'

Try things above and let me know the error message if the still occurs.

yang628 commented 6 years ago

I am very happy to receive your reply so soon. Here are the problems that are currently encountered in this project:

  1. In preprocess.py, in the screenshot w2v = word2vec.Word2Vec(iter=args.w2v_iter, min_count=1, size=args.w2v_dim, window=args.w2v_win, sg=args.sg) and import w2v_test The package is? The first one I often use from gensim.models import word2vec; The second import w2v_test is your own package? Can it be provided? image

  2. Just a brief comparison, the project and https://github.com/rdevooght/sequence-based-recommendations#user-knn preprocess.py in this project and found that the author has improved:

  3. Undelete users and projects that appear to have too few interactions.

    data = remove_rare_elements(data, args.min_user_activity, args.min_item_pop, args.min_time_diff)

    Can you elaborate on what improvements have been made in preprocessing?

  4. Must use preprocess.py in the project to generate data? Tried preprocess.py in the project with https://github.com/rdevooght/sequence-based-recommendations#user-knn

I am very much looking forward to your reply again.

中文: 很高兴这么快收到您的答复。 一下是目前在本项目中遇到的问题: 1.在preprocess.py中,截图中的 w2v = word2vec.Word2Vec(iter=args.w2v_iter, min_count=1, size=args.w2v_dim, window=args.w2v_win, sg=args.sg)和import w2v_test 您用的包是?第一个我常使用了from gensim.models import word2vec;第二个import w2v_test,是您自己封装的吗?可以提供吗?

2.刚才大致对比了一下,该项目与https://github.com/rdevooght/sequence-based-recommendations#user-knn 该项目中的preprocess.py,发现作者改进了: 1.取消删除出现在交互太少的用户和项目。

data = remove_rare_elements(data, args.min_user_activity, args.min_item_pop, args.min_time_diff)

可以详细说明在预处理做了哪些改进吗?

3.必须用该项目中的preprocess.py生成数据吗?尝试了用https://github.com/rdevooght/sequence-based-recommendations#user-knn 该项目中的preprocess.py 生成的样本,程序train.py。

非常期待您的再次回复。

kwonmha commented 6 years ago

Almost all modifications involved in preprocess.py are personal and improper to be opened. They are just a part of my many trials and I have forgotten about them. Particularly, things related to word2vec in preprocess.py shouldn't be uploaded to my github. I don't use them(word2vec things) anymore.

There's no improvement in preprocess.py. I'll make this file back to almost same as it was.

The improvements I made in this project compared to rdevooght's is using 'weight tying' technique used during training as I mentioned in readme.md. It improved the performance.

You can use either original(rdevooght's ) preprocess.py or my preprocessed.py that will be almost same to the original one. But as I mentioned, you'd better to download zip file(this file includes benchmark datasets and preprocessed data that rdevooght and I actually used on experiment for paper) from the link in readme.md. You can use any results to train model.

Since I knew that I need to use downloaded data to reproduce the results of rdevooght's paper, I didn't make any modification to the preprocess.py. I tried to set almost everything same as rdevooght's setting and then tried to improve recommendation model.

yang628 commented 6 years ago

Thank you very much for your answer. I downloaded the data set you provided. Strictly follow the readme instructions to install the operating environment. The following are exceptions that occur during training. Do not know how to handle it. 1. Exception error image I tried to modify it, I do not know whether it is feasible. max_length = int(seq.get_shape()[1]) input_size = int(seq.get_shape()[2])

I tried to modify it

max_length = int((seq[1].shape)[1]) input_size = int((seq[1].shape)[2])

  1. But after I modified it, I got the following error again: image I don't know how to make changes now and I hope to get your help. My computer(MacBook Pro (Retina, 15-inch, Mid 2015)) does not have a Gpu. Will this affect the operation?Thank you again for your enthusiasm and answers.
yang628 commented 6 years ago

I'm very sorry that the mistakes that occurred during the training were due to my own parameters. I am very embarrassed to give you the trouble. I appreciate your talent.

kwonmha commented 6 years ago

It's ok. You don't have to feel sorry :) Feel free to ask me anytime.