RecVAE icon indicating copy to clipboard operation
RecVAE copied to clipboard

epoch result: nan for ndcg

Open mir-boz opened this issue 3 years ago • 2 comments

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)

image

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.

mir-boz avatar Mar 29 '21 18:03 mir-boz

Try running it python2. That worked for me.

anirudhnkl avatar Jun 01 '21 02:06 anirudhnkl

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

kinggodhj avatar Sep 28 '21 01:09 kinggodhj