Topics

Runtime error when computing persistence diagram

cai.507@...
 

Hi Dimitriy,

I have been used Dionysus to compute the persistence diagram for a long time. But recently I encounter a strange runtime error. Here is a small example that is able to reproduce the error. (RuntimeError: Trying to access non-existent cell: <-573487952>)

I am using Dionysus '2.0.6.dev0'. Running this example using python2 and python3 both throws the same runtime error.  Could you take a look at what happened? 

Best,
Chen
def dionysus_test():
simplices = [([0, 6], 0.0035655512881059928),
([0, 5], 0.004388370816130452),
([0, 4], 0.024136039488717488),
([0, 3], 0.035381239705051776),
([3, 5], 0.035381239705051776),
([0, 1], 0.9824465164612051),
([1, 1], 0.9824465164612051),
([1, 3], 0.9824465164612051),
([1, 4], 0.9824465164612051),
([1, 5], 0.9824465164612051),
([1, 6], 0.9824465164612051),
([0, 2], 0.9999999997257268),
([1, 2], 0.9999999997257268),
([2, 2], 0.9999999997257268),
([2, 3], 0.9999999997257268),
([2, 4], 0.9999999997257268),
([2, 5], 0.9999999997257268),
([2, 6], 0.9999999997257268),
([0], 0.0016456390560489196),
([6], 0.0035655512881059928),
([5], 0.004388370816130452),
([4], 0.024136039488717488),
([3], 0.035381239705051776),
([1], 0.9824465164612051),
([2], 0.9999999997257268)]
f = d.Filtration()
for vertices, time in simplices:
f.append(d.Simplex(vertices, time))
f.sort()
m = d.homology_persistence(f)
for i, c in enumerate(m):
print(i, c)

Dmitriy Morozov
 

I can't reproduce this problem (on Dionysus 2.0.7.dev0). When I run your example, I get:

2 1*0 + 1*1
4 1*0 + 1*3
6 1*0 + 1*5
8 1*0 + 1*7
10 
11 1*0 + 1*10
12 
13 
14 
15 
16 
17 
18 1*0 + 1*17
19 
20 1*0 + 1*0
21 
22 
23 
24 

On Sat, Feb 16, 2019 at 11:19 AM <cai.507@...> wrote:
Hi Dimitriy,

I have been used Dionysus to compute the persistence diagram for a long time. But recently I encounter a strange runtime error. Here is a small example that is able to reproduce the error. (RuntimeError: Trying to access non-existent cell: <-573487952>)

I am using Dionysus '2.0.6.dev0'. Running this example using python2 and python3 both throws the same runtime error.  Could you take a look at what happened? 

Best,
Chen
def dionysus_test():
simplices = [([0, 6], 0.0035655512881059928),
([0, 5], 0.004388370816130452),
([0, 4], 0.024136039488717488),
([0, 3], 0.035381239705051776),
([3, 5], 0.035381239705051776),
([0, 1], 0.9824465164612051),
([1, 1], 0.9824465164612051),
([1, 3], 0.9824465164612051),
([1, 4], 0.9824465164612051),
([1, 5], 0.9824465164612051),
([1, 6], 0.9824465164612051),
([0, 2], 0.9999999997257268),
([1, 2], 0.9999999997257268),
([2, 2], 0.9999999997257268),
([2, 3], 0.9999999997257268),
([2, 4], 0.9999999997257268),
([2, 5], 0.9999999997257268),
([2, 6], 0.9999999997257268),
([0], 0.0016456390560489196),
([6], 0.0035655512881059928),
([5], 0.004388370816130452),
([4], 0.024136039488717488),
([3], 0.035381239705051776),
([1], 0.9824465164612051),
([2], 0.9999999997257268)]
f = d.Filtration()
for vertices, time in simplices:
f.append(d.Simplex(vertices, time))
f.sort()
m = d.homology_persistence(f)
for i, c in enumerate(m):
print(i, c)

cai.507@...
 

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. 

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. 

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. 

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. 

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