epfl-lts2 / pygsp

Graph Signal Processing in Python
https://pygsp.rtfd.io
BSD 3-Clause "New" or "Revised" License
483 stars 93 forks source link

compute_fourier_basis Assertion error #48

Closed shreyashi2104 closed 5 years ago

shreyashi2104 commented 5 years ago

I'm having trouble getting pastassert -1e-12 < G1._e[0] < 1e-12 with a graph when I try to compute its fourier basis, so I'm wondering why this assertion would fail? Why does the largest eigenvalue have to be within that range? How to move past this error? I printed the e[0] and it was -6.426935757176126e-12 But why is it termed as erroneous?

nperraud commented 5 years ago

Hi @shreyashi2104, The goal of this assertion is to test that the smallest eigenvalue is 0. However, the tolerance is a bit tight. It is a known bug that has already been fixed in master. The line is now:

assert -1e-5 < self._e[0] < 1e-5

The simplest fix is probably that you replace this line in your code. Everything will be fine with the next version.

Good luck

shreyashi2104 commented 5 years ago

Thank you for your help. Once the assert statement was replaced, it could compute the values.