GraRep implementation questions
vpozdnyakov opened this issue · comments
Hello, I have some questions about GraRep implementation.
- In the original paper [1] authors propose to calculate log probability matrix as follows:
where A is a transition matrix and beta is lambda / number of nodes (Algorithm 1). But your implementation in _create_target_matrix
is follows:
scores = np.log(self._A_tilde.data) - math.log(self._A_tilde.shape[0])
That is, there is no normalization of the transition matrix and there is subtraction of log(number of nodes) instead of log(lambda/number of nodes).
- Authors propose to assign all negative values in log probability matrix to 0 (Algorithm 1), but your implementation in
_create_target_matrix
is follows:
scores = scores[scores < 0]
That is, you drop all positive values instead of negative values.
Could you please clarify why there are such discrepancies between the paper and implementation? In my own empirical experiments with social graphs, the both options (yours and authors') work well, but I do not understand if it is a bug or there are some reasons to convert the original algorithm in a such way.
[1] GraRep: Learning Graph Representations with Global Structural Information. ShaoSheng Cao, Wei Lu, and Qiongkai Xu. WWW, 2015. [Paper]