Pytorch implementation of paper: Multi-Interest Network with Dynamic Routing for Recommendation at Tmall
- Amazon books ratings, in Files -> "Small" subsets for experimentation -> choose Books ratings only in the table.
- Amazon books metadata, int Files -> Complete review data -> choose Books metadata in the table.
- Create a folder called
data
. Download and unzip the data files into thedata
folder, such that thedata
folder contains two files:meta_Books.json
andratings_Books.csv
. - Run with default config:
python main.py
- Then you can see the output like this:
preparing data
start training
Epoch 00 | Step 00000 | Loss 25.838057
Epoch 00 | Step 00200 | Loss 2.774709
Epoch 00 | Step 00400 | Loss 1.765235
Epoch 00 | Step 00600 | Loss 1.416502
...
Epoch 49 | Step 02000 | Loss 0.217909
Epoch 49 | Step 02200 | Loss 0.217899
Epoch 49 | Step 02400 | Loss 0.217884
start testing
100%|█████████████████████████████████████████████████| 1630/1630 [00:23<00:00, 67.99it/s]
recall@30: 0.06549379147251112, hitRate@30: 0.3280333304991072
Each rating action reflect user's interest upon that book, so each rating action is one postive sample, no matter what the actual rating value is. From my point of view, If the user read the book and gave a rate about it, he is interested in the book anyway. Low rate means he is disappointed with the content, rather than "not interested".
- l2 norm & test via faiss
- introduce meta data and:
- item embedding distribution
- take a look into interest caps