hidasib / GRU4Rec

GRU4Rec is the original Theano implementation of the algorithm in "Session-based Recommendations with Recurrent Neural Networks" paper, published at ICLR 2016 and its follow-up "Recurrent Neural Networks with Top-k Gains for Session-based Recommendations". The code is optimized for execution on the GPU.
Other
754 stars 223 forks source link

Additional Negative Sampling: Conditional Statement Logic Error #31

Closed yhshu closed 4 years ago

yhshu commented 5 years ago

https://github.com/hidasib/GRU4Rec/blob/0438f25ce667aa907d3e3b0b159ecda56991a4cb/gru4rec.py#L554

https://github.com/hidasib/GRU4Rec/blob/0438f25ce667aa907d3e3b0b159ecda56991a4cb/gru4rec.py#L564

https://github.com/hidasib/GRU4Rec/blob/0438f25ce667aa907d3e3b0b159ecda56991a4cb/gru4rec.py#L566

The conditional logic of these three lines seems to be unreasonable. Is the branch starting at line 566 redundant?

if self.n_sample:
                            if sample_pointer == generate_length:
                                generate_samples()
                                sample_pointer = 0
                            sample_pointer += 1

Also, I did not see the definition of the function generate_samples. Thanks.

hidasib commented 4 years ago

Same as #32 . That function was not supposed to get into the public version that time, but has been included in the recent update along with other speedups.