Python implementation persistent images representation of persistence diagrams.
Persim is a Python implementation of Persistence Images as first introduced in https://arxiv.org/abs/1507.06217.
It is designed to interface with Ripser, though any persistence diagram should work fine.
Currently, the only option is to install the library from source:
pip install persim
First, construct a diagram. In this example, we will use Ripser.
import numpy as np from ripser import Rips from sklearn import datasets data = np.concatenate([150 * np.random.random((300,2)), 10 + 10 * datasets.make_circles(n_samples=100), 100 + 20 * datasets.make_circles(n_samples=100)]) rips = Rips() dgm = rips.fit_transform(data) diagram = dgm # Just diagram for H1
Then from this diagram, we construct the persistence image
from persim import PersImage pim = PersImage() img = pim.transform(diagram) pim.show(img)
- Implement a variety of weighting and kernel functions.
Persistence Images were first introduced in Adams et al, 2017. Much of this work, an examples contained herein are inspired by the work of Obayashi and Hiraoka, 2017. Choices of weightings and general methods are often derived from Kusano, Fukumizu, and Yasuaki Hiraoka, 2016.
Release history Release notifications | RSS feed
Download the file for your platform. If you're not sure which to choose, learn more about installing packages.
|Filename, size||File type||Python version||Upload date||Hashes|
|Filename, size persim-0.0.5-py3-none-any.whl (4.6 kB)||File type Wheel||Python version py3||Upload date||Hashes View|
|Filename, size persim-0.0.5.tar.gz (5.2 kB)||File type Source||Python version None||Upload date||Hashes View|