- Objectives
- Compute persistence via cubical, Rips, Alpha backends
- Extract feature vectors; understand persistence images/landscapes
- Time: 60–90 minutes
import numpy as np
from mneme.core.topology import PersistentHomology
field = np.random.randn(64,64)
ph = PersistentHomology(max_dimension=2, filtration='sublevel', persistence_threshold=0.05)
diagrams = ph.compute_persistence(field)
features = ph.extract_features(diagrams)from mneme.core.topology import RipsComplex, AlphaComplex, field_to_point_cloud
pc = field_to_point_cloud(field, method='peaks', percentile=95.0, max_points=2000)
rc = RipsComplex(max_dimension=1)
rd = rc.compute_persistence(pc)
rf = rc.extract_features(rd)- Use
compute_persistence_image/compute_persistence_landscapehelpers for derived representations
- Compare feature vectors across backends on the same field
- Increase
percentileinfield_to_point_cloudand see how point density affects Rips results - Plot a persistence image for H1 and interpret visually
Run log (MVP)
- Success: Cubical and Rips both produced 2 diagrams with 12-length feature vectors in a quick test.
Solutions (outline)
- Different backends produce different sensitivities; features reflect scale and sampling
- Higher threshold → fewer points → sparser complexes
- Bright areas in persistence image correspond to long-lived features