att.topology¶
Persistent homology computation and topological summaries.
- class att.topology.PersistenceAnalyzer(max_dim=2, backend='ripser', use_witness=False, n_landmarks=500)[source]¶
Bases:
objectCompute persistent homology on point clouds.
- Parameters:
- fit_transform(cloud, subsample=None, seed=None)[source]¶
Compute persistence diagrams and derived representations.
- Parameters:
cloud ((n_points, dimension) point cloud)
subsample (if int, randomly select this many points first)
seed (random seed for subsampling)
- Returns:
dict with diagrams, betti_curves, persistence_entropy,
bottleneck_norms, persistence_images, persistence_landscapes
- Return type:
- distance(other, metric='bottleneck')[source]¶
Compute distance between persistence diagrams.
- Parameters:
other (another PersistenceAnalyzer with computed diagrams)
metric ("bottleneck", "wasserstein_1", "wasserstein_2")
- Returns:
float
- Return type:
maximum distance across all dimensions
- to_image(resolution=50, sigma=0.1, birth_range=None, persistence_range=None)[source]¶
Convert diagrams to persistence images.
- Parameters:
resolution (int) – Grid size for the persistence image (resolution x resolution).
sigma (float) – Gaussian kernel bandwidth.
birth_range ((min, max) or None) – Explicit birth-axis range. If None, computed from data per diagram.
persistence_range ((min, max) or None) – Explicit persistence-axis range. If None, computed from data per diagram.
- Return type:
list of (resolution, resolution) arrays, one per homology dimension.
- class att.topology.PersistenceAnalyzer(max_dim=2, backend='ripser', use_witness=False, n_landmarks=500)[source]¶
Bases:
objectCompute persistent homology on point clouds.
- Parameters:
- fit_transform(cloud, subsample=None, seed=None)[source]¶
Compute persistence diagrams and derived representations.
- Parameters:
cloud ((n_points, dimension) point cloud)
subsample (if int, randomly select this many points first)
seed (random seed for subsampling)
- Returns:
dict with diagrams, betti_curves, persistence_entropy,
bottleneck_norms, persistence_images, persistence_landscapes
- Return type:
- distance(other, metric='bottleneck')[source]¶
Compute distance between persistence diagrams.
- Parameters:
other (another PersistenceAnalyzer with computed diagrams)
metric ("bottleneck", "wasserstein_1", "wasserstein_2")
- Returns:
float
- Return type:
maximum distance across all dimensions
- to_image(resolution=50, sigma=0.1, birth_range=None, persistence_range=None)[source]¶
Convert diagrams to persistence images.
- Parameters:
resolution (int) – Grid size for the persistence image (resolution x resolution).
sigma (float) – Gaussian kernel bandwidth.
birth_range ((min, max) or None) – Explicit birth-axis range. If None, computed from data per diagram.
persistence_range ((min, max) or None) – Explicit persistence-axis range. If None, computed from data per diagram.
- Return type:
list of (resolution, resolution) arrays, one per homology dimension.