a practical guide to persistent homology
play

A Practical Guide to Persistent Homology Dmitriy Morozov Lawrence - PowerPoint PPT Presentation

A Practical Guide to Persistent Homology Dmitriy Morozov Lawrence Berkeley National Lab A Practical Guide to Persistent Homology (Dionysus edition) from dionysus import * from dionysus.viewer import * Code snippets available at: from


  1. A Practical Guide to Persistent Homology Dmitriy Morozov Lawrence Berkeley National Lab

  2. A Practical Guide to Persistent Homology (Dionysus edition) from dionysus import * from dionysus.viewer import * Code snippets available at: from readers import * http://hg.mrzv.org/Dionysus-tutorial Dmitriy Morozov Lawrence Berkeley National Lab

  3. Dionysus • C++ library • Implements various algorithms that I’ve found interesting over the years: – ordinary persistence – vineyards – image persistence – zigzag persistence – persistent cohomology – circular coordinates – alpha shapes – Vietoris-Rips complexes – bottleneck and wasserstein distances between diagrams • To make life easier, added Python bindings • This talk exclusively in Python

  4. Python • Good news: You already know Python! It’s just like pseudo-code in your papers, but cleaner. ;-) • Lists and list comprehensions lst1 = [1,3,5,7,9,11,13] lst2 = [i for i in lst1 if i < 9] print lst2 # [1,3,5,7] • Functions def pow(x): def f(y): return y**x return f • Loops and conditionals for i in lst1: if i % 3 == 0 and i > 5: print square(i) • Lots of extra functionality in modules from math import sqrt from dionysus import *

  5. Persistent Homology • Over a decade old now. Introduced as a way to detect prominent topo- logical features in point clouds. Since then evolved into a rich theory with many applications. What is the homology of this point cloud?

  6. Persistent Homology • Over a decade old now. Introduced as a way to detect prominent topo- logical features in point clouds. Since then evolved into a rich theory with many applications. What is the homology of this point cloud? • “Squint our eyes”

  7. Persistent Homology • Over a decade old now. Introduced as a way to detect prominent topo- logical features in point clouds. Since then evolved into a rich theory with many applications. What is the homology of this point cloud? • “Squint our eyes”

  8. Persistent Homology • Over a decade old now. Introduced as a way to detect prominent topo- logical features in point clouds. Since then evolved into a rich theory with many applications. What is the homology of this point cloud? • “Squint our eyes”

  9. Persistent Homology • Over a decade old now. Introduced as a way to detect prominent topo- logical features in point clouds. Since then evolved into a rich theory with many applications. What is the homology of this point cloud? • “Squint our eyes”

  10. Persistent Homology • Over a decade old now. Introduced as a way to detect prominent topo- logical features in point clouds. Since then evolved into a rich theory with many applications. What is the homology of this point cloud? • “Squint our eyes”

  11. Persistent Homology • Over a decade old now. Introduced as a way to detect prominent topo- logical features in point clouds. Since then evolved into a rich theory with many applications. What is the homology of this point cloud? • “Squint our eyes” no natural fixed scale → persistent homology

  12. “Eye Squinting” P – point set in R n P r = ∪ p ∈ P B r ( p )

  13. “Eye Squinting” P – point set in R n P r = ∪ p ∈ P B r ( p )

  14. “Eye Squinting” P – point set in R n P r = ∪ p ∈ P B r ( p )

  15. “Eye Squinting” P – point set in R n P r = ∪ p ∈ P B r ( p )

  16. “Eye Squinting” P – point set in R n P r = ∪ p ∈ P B r ( p )

  17. “Eye Squinting” P – point set in R n P r = ∪ p ∈ P B r ( p ) 0 → H ( P r 1 ) → H ( P r 2 ) → . . . → H ( R n )

  18. “Eye Squinting” P – point set in R n P r = ∪ p ∈ P B r ( p ) Death 10 points Dgm 1 Birth 0 → H ( P r 1 ) → H ( P r 2 ) → . . . → H ( R n )

  19. “Eye Squinting” P – point set in R n P r = ∪ p ∈ P B r ( p ) Death 10 points Dgm 1 Birth 0 → H ( P r 1 ) → H ( P r 2 ) → . . . → H ( R n )

  20. “Eye Squinting” P – point set in R n P r = ∪ p ∈ P B r ( p ) Death 10 points Dgm 1 Birth Squinting our eyes gives us a continuous function. Algorithms work with (discrete) simplicial complexes. 0 → H ( P r 1 ) → H ( P r 2 ) → . . . → H ( R n )

  21. Simplices and Complexes 0 (Geometric) k -simplex: convex hull of ( k + 1) points. (Abstract) k -simplex: subset of ( k + 1) elements of a universal set. 2 1 i ( − 1) i [ v 0 , . . . , ˆ Boundary: ∂ [ v 0 , . . . , v k ] = � v i , . . . , v k ] s = Simplex([0,1,2]) Dimension: 2 print "Dimension:", s.dimension Vertices: 0 print "Vertices:" 1 for v in s.vertices: 2 print v Boundary: <1, 2> print "Boundary:" <0, 2> for sb in s.boundary: <0, 1> print sb

  22. Simplices and Complexes 0 (Geometric) k -simplex: convex hull of ( k + 1) points. (Abstract) k -simplex: subset of ( k + 1) elements of a universal set. 2 1 i ( − 1) i [ v 0 , . . . , ˆ Boundary: ∂ [ v 0 , . . . , v k ] = � v i , . . . , v k ] Simplicial complex: collection of simplices closed under face relation. 1 3 0 2 4 not a simplicial complex:

  23. Simplices and Complexes 0 (Geometric) k -simplex: convex hull of ( k + 1) points. (Abstract) k -simplex: subset of ( k + 1) elements of a universal set. 2 1 i ( − 1) i [ v 0 , . . . , ˆ Boundary: ∂ [ v 0 , . . . , v k ] = � v i , . . . , v k ] Simplicial complex: collection of simplices closed under face relation. 1 3 complex = [Simplex(vertices) for vertices in [[0], [1], [2], [3], [4], [5], 0 [0,1], [0,2], [1,2], [0,1,2], [1,3], [2,4], [3,4]]] 2 4 not a simplicial complex:

  24. Simplices and Complexes 0 (Geometric) k -simplex: convex hull of ( k + 1) points. (Abstract) k -simplex: subset of ( k + 1) elements of a universal set. 2 1 i ( − 1) i [ v 0 , . . . , ˆ Boundary: ∂ [ v 0 , . . . , v k ] = � v i , . . . , v k ] Simplicial complex: collection of simplices closed under face relation. 1 3 complex = [Simplex(vertices) for vertices in [[0], [1], [2], [3], [4], [5], 0 [0,1], [0,2], [1,2], [0,1,2], [1,3], [2,4], [3,4]]] 2 4 not a simplicial simplex9 = Simplex([0,1,2,3,4,5,6,7,8,9]) complex: sphere8 = closure([simplex9], 8) print len(sphere8) 1022

  25. Homology over Z 2 , a set of k -chain = formal sum of k -simplices simplices k -cycle = chain without a boundary k -boundary = boundary of an ( k + 1) -dimensional chain two cycles are homologous Z = cycle group if they differ by a boundary B = boundary group H = Z / B homology: count cycles up to differences by boundaries

  26. Homology in Dionysus Dionysus doesn’t compute homology directly, but we can get it as a by- product of persistent homology. complex = sphere8 Dimension: 0 0 inf f = Filtration(complex, dim_cmp) Dimension: 1 p = StaticPersistence(f) Dimension: 2 p.pair_simplices() Dimension: 3 Dimension: 4 dgms = init_diagrams(p,f, lambda s: 0) Dimension: 5 Dimension: 6 for i, dgm in enumerate(dgms): Dimension: 7 Dimension: 8 print "Dimension:", i 0 inf print dgm 03-complex.py

  27. Persistent Homology (pipeline) Filtration of a simplicial complex: K 1 ⊆ K 2 ⊆ . . . ⊆ K n (w.l.o.g. assume K i +1 = K i + σ i ). so, really, an ordering of simplices 1 2 3 2 4 2 5 2 6 1 1 1 1 1 0 0 0 0 0 0

  28. Persistent Homology (pipeline) Filtration of a simplicial complex: K 1 ⊆ K 2 ⊆ . . . ⊆ K n (w.l.o.g. assume K i +1 = K i + σ i ). so, really, an ordering of simplices 1 2 3 2 4 2 5 2 6 1 1 1 1 1 0 0 0 0 0 0 simplices = [([0], 1), ([1], 2), ([0,1], 3), ([2], 4), \ ([1,2], 5), ([0,2], 6)] f = Filtration() for vertices, time in simplices: f.append(Simplex(vertices, time)) f.sort(dim_data_cmp) for s in f: 04-1-filtration.py print s, s.data # s.data is the time

  29. Persistent Homology (pipeline) Filtration of a simplicial complex: K 1 ⊆ K 2 ⊆ . . . ⊆ K n (w.l.o.g. assume K i +1 = K i + σ i ). so, really, an ordering of simplices 1 2 3 2 4 2 5 2 6 1 1 1 1 1 0 0 0 0 0 0 H 1 : H 0 : H ( K 1 ) → H ( K 2 ) → . . . → H ( K n )

  30. Persistent Homology (pipeline) p = StaticPersistence(f) Filtration of a simplicial complex: p.pair_simplices() dgms = init_diagrams(p, f) K 1 ⊆ K 2 ⊆ . . . ⊆ K n for i, dgm in enumerate(dgms): print "Dimension:", i (w.l.o.g. assume K i +1 = K i + σ i ). print dgm 04-2-persistence.py so, really, an ordering of simplices 1 2 3 2 4 2 5 2 6 1 1 1 1 1 0 0 0 0 0 0 H 1 : H 0 : H ( K 1 ) → H ( K 2 ) → . . . → H ( K n )

  31. Filtrations: α -shapes K r = Nrv { B r ( u ) ∩ Vor u } P : K r ≃ ∪ p ∈ P B r ( p ) K r 1 ⊆ K r 2 ⊆ . . . ⊆ K r σ ⊆ . . .

  32. Filtrations: α -shapes K r = Nrv { B r ( u ) ∩ Vor u } P : K r ≃ ∪ p ∈ P B r ( p ) K r 1 ⊆ K r 2 ⊆ . . . ⊆ K r σ ⊆ . . .

  33. Filtrations: α -shapes K r = Nrv { B r ( u ) ∩ Vor u } P : K r ≃ ∪ p ∈ P B r ( p ) K r 1 ⊆ K r 2 ⊆ . . . ⊆ K r σ ⊆ . . .

  34. Filtrations: α -shapes K r = Nrv { B r ( u ) ∩ Vor u } P : K r ≃ ∪ p ∈ P B r ( p ) K r 1 ⊆ K r 2 ⊆ . . . ⊆ K r σ ⊆ . . .

  35. Filtrations: α -shapes K r = Nrv { B r ( u ) ∩ Vor u } P : K r ≃ ∪ p ∈ P B r ( p ) K r 1 ⊆ K r 2 ⊆ . . . ⊆ K r σ ⊆ . . .

  36. Filtrations: α -shapes K r = Nrv { B r ( u ) ∩ Vor u } P : K r ≃ ∪ p ∈ P B r ( p ) K r 1 ⊆ K r 2 ⊆ . . . ⊆ K r σ ⊆ . . .

Download Presentation
Download Policy: The content available on the website is offered to you 'AS IS' for your personal information and use only. It cannot be commercialized, licensed, or distributed on other websites without prior consent from the author. To download a presentation, simply click this link. If you encounter any difficulties during the download process, it's possible that the publisher has removed the file from their server.

Recommend


More recommend