guoyang9 / bpr-pytorch Goto Github PK
View Code? Open in Web Editor NEWA pytorch implementation for BPR (Bayesian Personalized Ranking).
A pytorch implementation for BPR (Bayesian Personalized Ranking).
能否将处理好的数据集新建一个文件放到代码中? 运行报找不到文件
您好!
在我预处理数据的时候,偶尔会在测试阶段出现以下错误:
Traceback (most recent call last):
File , line 215, in <module>
HR, NDCG = metrics(model, test_loader, top_k)
File "t.py", line 174, in metrics
prediction_i, prediction_j = model(user, item_i, item_j)
File "anaconda3/envs/BPR/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/t.py", line 137, in forward
item_i = self.embed_item(item_i)
File "/anaconda3/envs/BPR/lib/python3.10/site-packages/torch/nn/modules/module.py", line 1110, in _call_impl
return forward_call(*input, **kwargs)
File "/anaconda3/envs/BPR/lib/python3.10/site-packages/torch/nn/modules/sparse.py", line 158, in forward
return F.embedding(
File "/anaconda3/envs/BPR/lib/python3.10/site-packages/torch/nn/functional.py", line 2183, in embedding
return torch.embedding(weight, input, padding_idx, scale_grad_by_freq, sparse)
IndexError: index out of range in self
我用了同样的预处理方:假设我用原始数据前1000行,就会顺利跑;但如果我用全部数据,就会出现这个错误。实在debug不出来,想问问您知道原因吗?
我的train data都是[[1,2],[1,3],...].
test data [[1,4],[1,34]..]. (第一对是seen user item,之后的99对是从全部item 中挑 user1 没有看过的,以此类推。
感谢!
您好,您的数据集可以共享下吗?谢谢
how can I solve this problem?
Hello,
I have some trouble while understanding this log function. It looks no obvious influence after removing this log Intuitively, but the experiment shows it really has about a 10% performance penalty. By increasing the number of epochs, it back to the origin line. I guess the log function may make the network convergence early. What is the difference between these two situations?
And, as I have poor knowledge about sampling, is it necessary to take a negative sample processing in every epoch?
A declarative, efficient, and flexible JavaScript library for building user interfaces.
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
An Open Source Machine Learning Framework for Everyone
The Web framework for perfectionists with deadlines.
A PHP framework for web artisans
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
Some thing interesting about web. New door for the world.
A server is a program made to process requests and deliver data to clients.
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
Some thing interesting about visualization, use data art
Some thing interesting about game, make everyone happy.
We are working to build community through open source technology. NB: members must have two-factor auth.
Open source projects and samples from Microsoft.
Google ❤️ Open Source for everyone.
Alibaba Open Source for everyone
Data-Driven Documents codes.
China tencent open source team.