question-mark
Stuck on an issue?

Lightrun Answers was designed to reduce the constant googling that comes with debugging 3rd party libraries. It collects links to all the places you might be looking at while hunting down a tough bug.

And, if you’re still stuck at the end, we’re happy to hop on a call to see how we can help out.

compute_fourier_basis Assertion Error

See original GitHub issue

I’m having trouble getting past assert self._e[-1] <= 2 with a graph when I try to compute its fourier basis, so I’m wondering in why this assertion would fail? Why does the largest eigenvalue have to be <= 2?

Issue Analytics

  • State:closed
  • Created 6 years ago
  • Reactions:2
  • Comments:7 (2 by maintainers)

github_iconTop GitHub Comments

2reactions
mdeffcommented, Jan 26, 2018

It’s indeed a numerical issue then (your largest eigenvalue is marginally above 2). We’ll relax the assertion. In the mean time you can just comment it. Thanks for reporting!

1reaction
nperraudcommented, Jan 18, 2018

This assertion is only done if the Laplacian is normalized.

if self.lap_type == 'normalized':
     # Spectrum bounded by [0, 2].
     assert self._e[-1] <= 2

In this case, the spectrum has to be bounded by 2 from the theory. So if your weight matrix is non-negative and symmetric, it should always pass this test.

Read more comments on GitHub >

github_iconTop Results From Across the Web

numpy - Python error when calling Fourier transform code
Python error when calling Fourier transform code ... IntType) or isinstance(n, integer) AssertionError. The code is:
Read more >
Source code for pygsp.graphs.fourier
_check_fourier_properties('U', 'Fourier basis') @property def e(self): r"""Eigenvalues of the Laplacian (square of graph frequencies). Is computed by ...
Read more >
The Fourier basis — Tutorials on imaging, computing and ...
→ck,→sk are Fourier basis vectors. We can compile all these vectors into matrices to form Fourier basis matrices. Rewriting the DFT with cosine...
Read more >
Fourier approximation error in L^2 for piecewise ...
I am quite sure that a bound of the form (∗) holds for generic piecewise continuous functions on [0,2π), but I didn't manage...
Read more >
Fourier Analysis for Beginners - Indiana University
basis functions, convolution, sampling, aliasing, and the statistical reliability of. Fourier coefficients computed from real-world data.
Read more >

github_iconTop Related Medium Post

No results found

github_iconTop Related StackOverflow Question

No results found

github_iconTroubleshoot Live Code

Lightrun enables developers to add logs, metrics and snapshots to live code - no restarts or redeploys required.
Start Free

github_iconTop Related Reddit Thread

No results found

github_iconTop Related Hackernoon Post

No results found

github_iconTop Related Tweet

No results found

github_iconTop Related Dev.to Post

No results found

github_iconTop Related Hashnode Post

No results found