Comments (7)
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!
from pygsp.
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.
from pygsp.
Thank you so much for the reply; I really appreciate it.
Hmmm... this is strange, then. The minimum weight in my weight matrix is 1 and G.is_directed() returns False. Any other possible reasons this would fail?
Edit: I tried this:
Gg=pygsp.graphs.Graph(nx.adjacency_matrix(G),lap_type='normalized')
e, U = np.linalg.eigh(Gg.L.toarray())
print e[-1]
Gg.compute_fourier_basis(recompute=True)
This printed 2.0 followed by the assertion error assert self._e[-1] <= 2
Also, I have the following:
print "largest eigenvalue:", Gg._e[-1]
print "Gg._e[-1] == 2.0", Gg._e[-1] == 2.0
print "2.0 <= 2", 2.0 <= 2
print "Gg._e[-1] <= 2", Gg._e[-1] <= 2
print "float(Gg._e[-1]) == 2.0", float(Gg._e[-1]) == 2.0
print "float(Gg._e[-1])", float(Gg._e[-1])
The print output of the above is:
largest eigenvalue: 2.0
Gg._e[-1] == 2.0 False
2.0 <= 2 True
Gg._e[-1] <= 2 False
float(Gg._e[-1]) == 2.0 False
float(Gg._e[-1]) 2.0
I'm pretty confused now. It seems like when I print Gg._e[-1], its value is 2.0, yet the comparisons aren't working.
from pygsp.
It really looks like a numerical error. We should relax slightly the assertion. I will do it this afternoon.
Thanks for reporting this bug.
from pygsp.
Could you print for us self._e[-1]-2
?
from pygsp.
It prints out 4.84057238737e-14.
from pygsp.
That was fixed in 58421d5.
from pygsp.
Related Issues (20)
- inverse method not working for any filter HOT 4
- Import issues after installation HOT 1
- from_networkx() and to_networkx() method are not working
- How to get edge weights as node signal of LineGraph
- Filtering assumes Hermitian/symmetric Laplacian
- Inability of handling large matrix due to dense matrix operation in Graph.compute_fourier_basis HOT 2
- Graph processing
- Could you maybe explain how to create a high-pass filter? HOT 3
- Possibility to change node shape when plotting signal? HOT 3
- `min_deg` argument of Community class doesn't work? HOT 1
- Bug in `interpolate()` when graph has no `mr` attribute HOT 2
- Install latest version with latest functionality HOT 4
- How to keep the signal values of a heat diffusion higher HOT 1
- feat: Changing the signal colormap in plotting function
- Question on importing from segmented numpy array or point cloud cloud HOT 10
- maybe a bug about extract_components(self) HOT 1
- Memory usage reduction HOT 4
- GraphWave? HOT 13
- Heat filter not working HOT 9
- Add support for the magnetic laplacian HOT 6
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pygsp.