Date   
Re: Runtime error when computing persistence diagram

Kowshik Thopalli
 

If it helps, Dimitry, I ran the same code as the OP tested in my ubuntu and can reproduce the runtime error
Ubuntu 16.04
python 3.6.2
dionysus- 2.0.5

RuntimeError: Trying to access non-existent cell: <39928304>
I ran it twice and every time there is a different cell number as op mentioned. 


On Sat, Feb 16, 2019 at 2:41 PM <cai.507@...> wrote:
Hi Dimitriy,

Thanks for quick reply. It seems that this problem is system dependent. I tried running on the same code on Ubuntu at different versions of Dionysus, it throws the same error(RuntimeError: Trying to access non-existent cell: <-573487952>, although the cell number is random each time.).

But if I switch to MacOS, I can get the same result with yours. 

Re: Runtime error when computing persistence diagram

Dmitriy Morozov
 

Thanks to both of you. I just tried it on Linux, and I see the same error. Now that I can reproduce it, I can figure out what it is.

Chen, can you file this as a bug on GitHub, so I can keep track of it there?


On Sat, Feb 16, 2019 at 1:49 PM Kowshik Thopalli <kthopall@...> wrote:
If it helps, Dimitry, I ran the same code as the OP tested in my ubuntu and can reproduce the runtime error
Ubuntu 16.04
python 3.6.2
dionysus- 2.0.5

RuntimeError: Trying to access non-existent cell: <39928304>
I ran it twice and every time there is a different cell number as op mentioned. 


On Sat, Feb 16, 2019 at 2:41 PM <cai.507@...> wrote:
Hi Dimitriy,

Thanks for quick reply. It seems that this problem is system dependent. I tried running on the same code on Ubuntu at different versions of Dionysus, it throws the same error(RuntimeError: Trying to access non-existent cell: <-573487952>, although the cell number is random each time.).

But if I switch to MacOS, I can get the same result with yours. 

Re: Runtime error when computing persistence diagram

Dmitriy Morozov
 

BTW, if I had to guess, I'd guess that the issue are the non-simplices: [1,1] and [2,2]. What are they supposed to represent?


On Sat, Feb 16, 2019 at 1:53 PM Dmitriy Morozov <dmitriy@...> wrote:
Thanks to both of you. I just tried it on Linux, and I see the same error. Now that I can reproduce it, I can figure out what it is.

Chen, can you file this as a bug on GitHub, so I can keep track of it there?

On Sat, Feb 16, 2019 at 1:49 PM Kowshik Thopalli <kthopall@...> wrote:
If it helps, Dimitry, I ran the same code as the OP tested in my ubuntu and can reproduce the runtime error
Ubuntu 16.04
python 3.6.2
dionysus- 2.0.5

RuntimeError: Trying to access non-existent cell: <39928304>
I ran it twice and every time there is a different cell number as op mentioned. 


On Sat, Feb 16, 2019 at 2:41 PM <cai.507@...> wrote:
Hi Dimitriy,

Thanks for quick reply. It seems that this problem is system dependent. I tried running on the same code on Ubuntu at different versions of Dionysus, it throws the same error(RuntimeError: Trying to access non-existent cell: <-573487952>, although the cell number is random each time.).

But if I switch to MacOS, I can get the same result with yours. 

Re: Runtime error when computing persistence diagram

cai.507@...
 

Hi Dimitriy and Kowshik,
 
You are right. If I deleted [1,1] and [2,2]. The code is able to run without any problem.
The filtration comes from a function on graphs. [1,1] and [2,2] corresponds to two self loops.
I should have checked if the graph has the self loops before computing the persistence diagram. 
I filed this on the github already.
 
Best,
Chen 

The plot_bars function's question

"Jay
 

Hi Dimitriy,

I'm new to Dionysus (and to studying homology persistence),when I try to use Dionysus2 to achieve the learning-demo(from http://outlace.com/TDApart5.html),I got a problem which the plot_bars missing the longest bar in Betti 0,but the plot_bars work in Betti 1 is right.


 My achieve     should be
this is my code:

import numpy as np
import dionysus as d
from __future__ import print_function

data = np.array([[1,4],[1,1],[6,1],[6,4]],dtype='double')
f = d.fill_rips(data, 2, 8.0)
p = d.homology_persistence(f)
dgms = d.init_diagrams(p, f)

d.plot.plot_bars(dgms[0],order='birth')

when I want to print the p,I got these message:

<0> 0:
<1> 0:
<2> 0:
<3> 0:
<0,1> 3:1 * <0> 0+1 * <1> 0
<2,3> 3:1 * <2> 0+1 * <3> 0
<0,3> 5:1 * <0> 0+1 * <2> 0
<1,2> 5:
<0,2> 5.83095:
<1,3> 5.83095:
<0,1,2> 5.83095:1 * <0,1> 3+1 * <1,2> 5+1 * <0,2> 5.83095
<0,1,3> 5.83095:1 * <0,1> 3+1 * <0,3> 5+1 * <1,3> 5.83095
<0,2,3> 5.83095:1 * <0,1> 3+1 * <2,3> 3+1 * <0,3> 5+1 * <1,2> 5
<1,2,3> 5.83095:

Thank you very much!

Best,
Jay

Re: The plot_bars function's question

"Jay
 

the right plot is 

Re: The plot_bars function's question

Dmitriy Morozov
 

Hi Jay,

It looks like we are not plotting points/bars at infinity. I don't recall doing this on purpose, so we should consider it a bug. Can you file an issue on GitHub?

Thanks.
Dmitriy

On Wed, Feb 27, 2019 at 8:23 PM "周浩文 <zhw96@...> wrote:
Hi Dimitriy,

I'm new to Dionysus (and to studying homology persistence),when I try to use Dionysus2 to achieve the learning-demo(from http://outlace.com/TDApart5.html),I got a problem which the plot_bars missing the longest bar in Betti 0,but the plot_bars work in Betti 1 is right.


 My achieve     should be
this is my code:

import numpy as np
import dionysus as d
from __future__ import print_function

data = np.array([[1,4],[1,1],[6,1],[6,4]],dtype='double')
f = d.fill_rips(data, 2, 8.0)
p = d.homology_persistence(f)
dgms = d.init_diagrams(p, f)

d.plot.plot_bars(dgms[0],order='birth')

when I want to print the p,I got these message:

<0> 0:
<1> 0:
<2> 0:
<3> 0:
<0,1> 3:1 * <0> 0+1 * <1> 0
<2,3> 3:1 * <2> 0+1 * <3> 0
<0,3> 5:1 * <0> 0+1 * <2> 0
<1,2> 5:
<0,2> 5.83095:
<1,3> 5.83095:
<0,1,2> 5.83095:1 * <0,1> 3+1 * <1,2> 5+1 * <0,2> 5.83095
<0,1,3> 5.83095:1 * <0,1> 3+1 * <0,3> 5+1 * <1,3> 5.83095
<0,2,3> 5.83095:1 * <0,1> 3+1 * <2,3> 3+1 * <0,3> 5+1 * <1,2> 5
<1,2,3> 5.83095:

Thank you very much!

Best,
Jay

Re: The plot_bars function's question

"Jay
 

Hi Dimitriy,

Thanks for quick reply.

In addition to the above problems, I also found an unreasonable exception,the plot bar always missing some longer bars when our radius is not bigger enough.

For example, the above example,
when I set radius = 8
when I set radius = 4

In my opinion, when I set the radius to 4, we should get 3 bars of length 3 instead of 2 bars of length 3.

Re: The plot_bars function's question

Dmitriy Morozov
 

It's the same problem. You should get an extra bar of infinite length in the second example. You in fact have the point in the diagram, if you examine it by hand, but it's not plotted.


On Thu, Feb 28, 2019 at 7:16 PM "Jay <zhw96@...> wrote:
Hi Dimitriy,

Thanks for quick reply.

In addition to the above problems, I also found an unreasonable exception,the plot bar always missing some longer bars when our radius is not bigger enough.

For example, the above example,
when I set radius = 8
when I set radius = 4

In my opinion, when I set the radius to 4, we should get 3 bars of length 3 instead of 2 bars of length 3.

Re: The plot_bars function's question

"Jay
 

Hi Dimitriy,

Thanks for quick reply again.

I have already submitted an issue on GitHub.

Fast Filtration Creation

tom
 

Hi Dimitry,

The docs seem to imply the only way to create a filtration is to loop over simplices and append them to the filtration. Is there a way for this iteration and Simplex object creation to be done within the C++ layer instead of looping and creating objects in Python? For example, if I can create a representation like the simplices variable in the filtration example on the docs, is there a way for me to pass this representation straight into, for example, the filtration's constructor and let it instantiate and add the simplices to the filtration?

Or if this is not possible, what do you suppose the fastest way to create a filtration from list-like representation in Python would be? 

Thanks! 

Re: Fast Filtration Creation

Dmitriy Morozov
 

You can pass simplices straight to the filtration constructor. There are actually three different versions of the constructor, but they are not showing up in the API docs for some reason. I'll need to figure out why.

In other words,

>>> import dionysus as d
>>> simplices = [([2], 4), ([1,2], 5), ([0,2], 6),
...              ([0], 1),   ([1], 2), ([0,1], 3)]
>>> f = d.Filtration(simplices)
>>> print(f)
Filtration with 6 simplices

Dmitriy

On Sat, Mar 16, 2019 at 9:36 AM tom <gebhart@...> wrote:
Hi Dimitry,

The docs seem to imply the only way to create a filtration is to loop over simplices and append them to the filtration. Is there a way for this iteration and Simplex object creation to be done within the C++ layer instead of looping and creating objects in Python? For example, if I can create a representation like the simplices variable in the filtration example on the docs, is there a way for me to pass this representation straight into, for example, the filtration's constructor and let it instantiate and add the simplices to the filtration?

Or if this is not possible, what do you suppose the fastest way to create a filtration from list-like representation in Python would be? 

Thanks! 

Re: Fast Filtration Creation

tom
 

Awesome, thank you.

Simplex Representation

tom
 

Hi Dimitry,

Would it be difficult to allow for other immutable objects/primitives to be used as Simplex identifiers in the python bindings? It would be super convenient to be able to index simplices by tuples or strings instead of just integers. 

Thanks 

Re: Simplex Representation

Dmitriy Morozov
 

This would be terrible for efficiency. I made a deliberate choice to disallow this. You can always add an extra layer of indirection: store your preferred type in a list and use that list's indices as the vertices for the simplices. 


On Thu, Mar 28, 2019 at 10:10 PM tom <gebhart@...> wrote:
Hi Dimitry,

Would it be difficult to allow for other immutable objects/primitives to be used as Simplex identifiers in the python bindings? It would be super convenient to be able to index simplices by tuples or strings instead of just integers. 

Thanks 

Re: Simplex Representation

tom
 

This implies the largest number of 0-dimensional simplices Dionysus can handle is the highest integer representation of an unsigned long int? 

Re: Simplex Representation

Dmitriy Morozov
 

Well, that's a very weak upper bound, since that number is astronomical. The actual computer memory is a far stronger limitation.


On Mon, Apr 15, 2019 at 11:19 AM tom <gebhart@...> wrote:
This implies the largest number of 0-dimensional simplices Dionysus can handle is the highest integer representation of an unsigned long int? 

Difference between R TDA package and python Dionysus2

K.A.Garside2@...
 

I've just been comparing the output between the Dionysus version in the TDA package in R and the python Dionysus 2 version and there are slightly different results.

I ran it on both sub and super level set filtration on a random field and got slightly different results. Is there a reason for the differences between the R and python implementation?

The 6x6 random field was as follows:

0.424929227922883 0.0128508228081597 -0.294177345297659 -0.49885453849692 -0.442318052990762 -0.626453810742332
0.201060103852361 -0.00595309362438814 -0.286812470518481 -0.845635155782885 -0.328884989662953 -0.539250210004794
0.172361359893672 0.0791446149595664 0.0298949263564899 -0.208043570082747 -0.280335952479328 -0.770728999699832
-0.0263036491145396 -0.158923878454222 0.239839365534883 -0.124288608608425 -0.289240676712963 -0.241020973140624
-0.423771084401562 -0.155098230023893 0.239843914614278 0.0208525497197847 0.14293072464965 -0.127618257296956
-0.371494249200723 -0.0954999907866207 -0.213831055439932 0.268132722688926 0.0128755839751564 -0.374495881349471


R gives the following diagrams:
# Sub level set:
     dimension      Birth       Death
[1,]         0 -0.8456352  0.42492923
[2,]         0 -0.7707290 -0.44231805
[3,]         0 -0.6264538 -0.53925021
[4,]         0 -0.4237711  0.02989493
[5,]         0 -0.3744959 -0.12761826
[6,]         0 -0.2892407 -0.28033595
[7,]         0 -0.2138311 -0.09549999

# Super level set
     dimension       Death      Birth
[1,]         0 -0.84563516  0.4249292
[2,]         0  0.02989493  0.2681327
[3,]         1 -0.28924068 -0.2803360
[4,]         1 -0.84563516 -0.4988545


Whilst the python Dionysus2 version gives:
# Sub level set 
0 -0.845635175704956 Inf
0 -0.7707290053367615 -0.44231805205345154
0 -0.6264538168907166 -0.5392501950263977
0 -0.42377108335494995 0.07914461195468903
0 -0.37449589371681213 -0.12761825323104858
0 -0.28924068808555603 -0.2803359627723694
0 -0.21383105218410492 -0.15509822964668274
0 -0.15892387926578522 -0.15509822964668274
1 0.020852549001574516 0.14293073117733002

# Super level set
0 0.4249292314052582 -Inf
0 0.2681327164173126 0.07914461195468903
0 0.14293073117733002 0.020852549001574516
0 -0.09549999237060547 -0.15509822964668274
1 -0.15509822964668274 -0.15892387926578522
1 -0.2803359627723694 -0.28924068808555603
1 -0.49885454773902893 -0.845635175704956
 

Re: Difference between R TDA package and python Dionysus2

Dmitriy Morozov
 

I don't know what the R package does, but if I had to guess, the two are using different triangulations of the domain. Dionysus 2 uses the Freudenthal triangulation; I don't know what the R package does. 


On Thu, May 30, 2019 at 11:23 AM <K.A.Garside2@...> wrote:
I've just been comparing the output between the Dionysus version in the TDA package in R and the python Dionysus 2 version and there are slightly different results.

I ran it on both sub and super level set filtration on a random field and got slightly different results. Is there a reason for the differences between the R and python implementation?

The 6x6 random field was as follows:

0.424929227922883 0.0128508228081597 -0.294177345297659 -0.49885453849692 -0.442318052990762 -0.626453810742332
0.201060103852361 -0.00595309362438814 -0.286812470518481 -0.845635155782885 -0.328884989662953 -0.539250210004794
0.172361359893672 0.0791446149595664 0.0298949263564899 -0.208043570082747 -0.280335952479328 -0.770728999699832
-0.0263036491145396 -0.158923878454222 0.239839365534883 -0.124288608608425 -0.289240676712963 -0.241020973140624
-0.423771084401562 -0.155098230023893 0.239843914614278 0.0208525497197847 0.14293072464965 -0.127618257296956
-0.371494249200723 -0.0954999907866207 -0.213831055439932 0.268132722688926 0.0128755839751564 -0.374495881349471


R gives the following diagrams:
# Sub level set:
     dimension      Birth       Death
[1,]         0 -0.8456352  0.42492923
[2,]         0 -0.7707290 -0.44231805
[3,]         0 -0.6264538 -0.53925021
[4,]         0 -0.4237711  0.02989493
[5,]         0 -0.3744959 -0.12761826
[6,]         0 -0.2892407 -0.28033595
[7,]         0 -0.2138311 -0.09549999

# Super level set
     dimension       Death      Birth
[1,]         0 -0.84563516  0.4249292
[2,]         0  0.02989493  0.2681327
[3,]         1 -0.28924068 -0.2803360
[4,]         1 -0.84563516 -0.4988545


Whilst the python Dionysus2 version gives:
# Sub level set 
0 -0.845635175704956 Inf
0 -0.7707290053367615 -0.44231805205345154
0 -0.6264538168907166 -0.5392501950263977
0 -0.42377108335494995 0.07914461195468903
0 -0.37449589371681213 -0.12761825323104858
0 -0.28924068808555603 -0.2803359627723694
0 -0.21383105218410492 -0.15509822964668274
0 -0.15892387926578522 -0.15509822964668274
1 0.020852549001574516 0.14293073117733002

# Super level set
0 0.4249292314052582 -Inf
0 0.2681327164173126 0.07914461195468903
0 0.14293073117733002 0.020852549001574516
0 -0.09549999237060547 -0.15509822964668274
1 -0.15509822964668274 -0.15892387926578522
1 -0.2803359627723694 -0.28924068808555603
1 -0.49885454773902893 -0.845635175704956
 

Re: Difference between R TDA package and python Dionysus2

K.A.Garside2@...
 

The R package states that it uses Dionysus as a library however? I assume that means it is not using Dionysus 2?

" For that, this package provides an R interface for the efficient algorithms of the C++ libraries 'GUDHI' <http://gudhi.gforge.inria.fr/>, 'Dionysus' <http://www.mrzv.org/software/dionysus/>, and 'PHAT' <https://bitbucket.org/phat-code/phat/>. "