uoguelph-mlrg / LDG

PyTorch code for "Learning Temporal Attention in Dynamic Graphs with Bilinear Interactions"
https://arxiv.org/abs/1909.10367
Other
98 stars 24 forks source link

Computation of integral term for dynamic link prediction #7

Open SimonTommerup opened 3 years ago

SimonTommerup commented 3 years ago

Hi

I am trying to make my own implementation of DyRep and have used your code and paper for inspiration. However, I have difficulty understanding your computation of the integral term in the conditional density.

In the function cond_density you do the following:

Lambda_sum = torch.cumsum(self.Lambda_dict.flip(0), 0).flip(0) / len(self.Lambda_dict)

i.e. the accumulated sum from most recent time step to the time step 4999 steps in the past divided by the number of steps.

Is it understood correctly that this something like a Riemann approximation of the integral term in the conditional density function (as you quote from the Dyrep paper on page 9)?

If yes, how do you take into account that the time steps in the sum are not equidistant?

Also I noticed that on the first evaluation (running with batch size of 200) the lambda_dict has only 4000 recordings - would this not influence the correctness of the sum approximation as it is still divided by 5000 but only has 4000 terms?

I hope that you have time to explain briefly what the intention is here.

And by the way thanks for uploading your code to Github 👍

Best regards Simon