wujcan / SGL-TensorFlow

173 stars 43 forks source link

RuntimeWarning: divide by zero encountered in power d_inv = np.power(rowsum, -0.5).flatten() #19

Closed OneSimplePerson closed 2 years ago

OneSimplePerson commented 2 years ago

Hello

I reported this error while running your code. Do I need to add a validation mechanism here, or is there a problem with my super-parameter adjustment? Hope to get your guidance, thank you!

wujcan commented 2 years ago

It's a warning indicating that there are some nodes whose degree is zero, and we have added the following code to correct it: d_inv[np.isinf(d_inv)] = 0.

So it's safe to run the code.

OneSimplePerson commented 2 years ago

I understand, thank you for your guidance!