hungpthanh / gru4rec-pytorch Goto Github PK
View Code? Open in Web Editor NEWAn other implementation of GRU4REC using PyTorch
License: Apache License 2.0
An other implementation of GRU4REC using PyTorch
License: Apache License 2.0
Hi,I have a question about how to run gru4rec and gru4rec+ with your code.From the paper,we can know these two methods vary in Loss Function and Sampling Strategy while the former is obvious in your code,I wonder how to apply the different sampling strategy.Thanks.
Hello, I found that the calculation of recall in the test set is obtained by taking topk after positive and negative sampling, which reduces the total candidate set from a large number of items to batch size. I think it may increase the recall value. May I ask why judge this way?
Hi, i have read your bench mark file https://docs.google.com/spreadsheets/d/19z6zFEY6pC0msi3wOQLk_kJsvqF8xnGOJPUGhQ36-wI/edit#gid=1577545099, and may i ask you if this code is GRU4Rec or GRU4Rec+, and can the Improved GRU4Rec bench marks be achieved with this code ? thank you.
Hi.
Thank you for sharing this code.
I found difference from original paper in regularization term of TOP1 Loss.
According to the original paper, the regularization term should be calculated over only negative samples1.
However, this repo calculates it over all samples2.
It might not be significant difference, but I just pointed it out.
How can we use the trained model to get item predictions for a user?
Hi, I have a question about the "mask" in DataLoader(),
for i in range(minlen - 1):
idx_input = idx_target
idx_target = df.item_idx.values[start + i + 1]
input = torch.LongTensor(idx_input)
target = torch.LongTensor(idx_target)
yield input, target, mask
'mask' is all the same during the for loop, but I think it should be reset to [] after the first loop.
Otherwise, the reset_hidden() will always reset the hidden state.
Could you check it, Thank you!
with torch.no_grad():
hidden = self.model.init_hidden()
for ii, (input, target, mask) in tqdm(enumerate(dataloader), total=len(dataloader.dataset.df) // dataloader.batch_size, miniters = 1000):
#for input, target, mask in dataloader:
input = input.to(self.device)
target = target.to(self.device)
logit, hidden = self.model(input, hidden)
logit_sampled = logit[:, target.view(-1)]
loss = self.loss_func(logit_sampled)
recall, mrr = lib.evaluate(logit, target, k=self.topk)
Hi, lib.evaluation.Evaluation does not reset hidden staes. Is that right?
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.