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
747 stars 222 forks source link

Code not working on a fresh install #16

Closed noveens closed 4 years ago

noveens commented 6 years ago

The code doesn't run on a fresh install.

Steps followed:

  1. python preprocess.py (used python3, runs successfully)
  2. python run_rsc15.py (tried using both python2 and 3 fails in both)

the output of the 2nd command:

Training GRU4Rec with 100 hidden units
0: NaN error!
hidasib commented 6 years ago

It does work, I've just checked it on a Titan X and an 1080Ti. Check your Theano and HW configuration! (Alternatively, you can set different hyperparameters, as NaN error means that the training is unstable. E.g. lower the learning rate and/or the momentum; or user the cross-entropy loss instead of BPR-max (it is more stable). The optimal hyperparameters for cross-entropy are different though (try something like batch_size=32, dropout_p_hidden=0.3, learning_rate=0.1, momentum=0.7, n_sample=2048, sample_alpha=0.0.)