A TensorFlow implementation of HGRU4Rec, which is based on the original theano version https://github.com/mquad/hgru4rec. Also, it refers an implementation of GRU4Rec by https://github.com/Songweiping/GRU4Rec_TensorFlow.
Note that I just implemented and verified only training process.
Python: 3.5
TensorFlow: 1.7
Pandas >= 0.22
tables>= 3.4.2
Please refer inner class class UserGRUCell4Rec(tf.nn.rnn_cell.MultiRNNCell):
- It is subclassing
MultiRNNCellwhich is for GRU_user. You can find my main TF conversion of overridingcall().
A difference with the author's implementation:
- Within
tf.variable_scope('session_gru'), I extend the initialization mechanism forinput_statesfor whole layered cells. - Original version does the initialization on the first layer onley.
python train_hgru4rec.py 100 100 --hdf_path=./data/retail_rocket.hdf --early_stopping
Currently XING data used in the original paper is not available. Therefore, I made a verifying data set from https://www.kaggle.com/retailrocket/ecommerce-dataset.
You can refer build_dataset.py from data/xing under https://github.com/mquad/hgru4rec to make your dataset.