Giter Club home page Giter Club logo

gru4rec-pytorch's People

Contributors

hungpthanh avatar mmaher22 avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar

gru4rec-pytorch's Issues

Question about the difference of the GRU4Rec and GRU4Rec+

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.

question about recall

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?

Difference from original paper: regularization term of TOP1 Loss

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.

Footnotes

  1. https://github.com/hidasib/GRU4Rec/blob/master/gru4rec.py#L236

  2. https://github.com/hungthanhpham94/GRU4REC-pytorch/blob/master/lib/lossfunction.py#L89

Predictions

How can we use the trained model to get item predictions for a user?

question about mask in data_loader

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!

Evaluation does not reset hidden states.

        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?

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.