RecVAE
RecVAE copied to clipboard
epoch result: nan for ndcg
Greetings to the team! Your code is beautiful, but I'm lost in the implementation of it.
I have the last version of PyTorch: https://pytorch.org/get-started/locally/ & Python
- Stable (1.8.1)
- OS: Windows
- Package: PiP
- Computer Platform: CUDA 11.1
- Python: 3.8.7
When I train the model I receive the outputs:
- test_te.csv
- test_tr.csv
- validation_tr.csv
- validation_te.csv
- train
- unique_sid
- unique_uid (For k = 100 in utils.py)
If I change the utils.py in the return of ndcg function for: return DCG/IDCG
to: return np.divide(DCG,IDCG, where=IDCG!=0)
it solve it, but still giving 'low' values. The latter in comparison with other VAE-CF results.
Can you help me, please?
Congratulations. I reiterate, your code is beautiful in comparison to tensorflow-keras implementation.
Best regards, Mirko.
Try running it python2. That worked for me.
I have the same problem with python 2.7 and python 3.8
The reason for Nan is zero value in Encoder In norm tensor, zero value exists and this makes Nan
x = x / norm[:, None]
so i add a new code to handle this problem
x = x / norm[:, None]
x[x != x] = 0