HGN icon indicating copy to clipboard operation
HGN copied to clipboard

A mistake on negative sampling

Open BenjaminChoou opened this issue 4 years ago • 1 comments

https://github.com/allenjack/HGN/blob/8bf6008e106fc3b1bc882bab6e65698e62c54ac6/run.py#L91

I think you may change it to this one. Otherwise, positive items can be sampled.

ret = np.asarray(neg_samples).reshape(train_matrix.shape[0], num_sets, num_neg)  # [n_user, ]
return np.transpose(ret, axes=[1, 0, 2])```

BenjaminChoou avatar Jul 07 '21 12:07 BenjaminChoou

Hi, that is a good suggestion. I will rewrite the negative sampling part into a multi-process manner later.

allenjack avatar Jul 07 '21 14:07 allenjack