Skip to main content

NAME
#

vectorize_PD - Vectorize a persistence diagram using a persistence image

SYNOPSIS
#

homcloud-vectorize-PD
    [-h] [-V] -d DEGREE [-T TYPE] [-N] [-x X_RANGE]
    [-X XBINS] [-y Y_RANGE] [-Y YBINS] -D GAUSSIAN_SD
    [-C C] [-p P] [-c COORDINATES]
    [-H HISTOGRAM_INFORMATION] [-o OUTPUT] [-w WEIGHT_TYPE]
    [--reorder-process]
    input

This program can also be invoked as python3 -m homcloud.cli.vectorize_PD.

ALIAS
#

homcloud-vectorize-PD

DESCRIPTION
#

This program vectorizes a persistence diagram using a persistence image: the birth-death pairs are binned into a 2D histogram, a weight function is applied, and the histogram is smoothed by a Gaussian filter. The result is flattened to a fixed-length vector.

OPTIONS
#

-h, --help            show this help message and exit
-V, --version         show program's version number and exit
-d DEGREE, --degree DEGREE
                      degree of PH
-T TYPE, --type TYPE  input file format (pdgm, text) (default:
                      autodetect)
-N, --negate          flip the sign of birth/death times for superlevel
                      persistence (default: False)
-x X_RANGE, --x-range X_RANGE
                      birth range
-X XBINS, --xbins XBINS
                      number of bins in birth-axis
-y Y_RANGE, --y-range Y_RANGE
                      death range
-Y YBINS, --ybins YBINS
                      number of bins in death-axis
-D GAUSSIAN_SD, --gaussian-sd GAUSSIAN_SD
                      standard deviation of gaussian diffusion
-C C                  weight constant C
-p P                  weight constant p
-c COORDINATES, --coordinates COORDINATES
                      file to write coordinates
-H HISTOGRAM_INFORMATION, --histogram-information HISTOGRAM_INFORMATION
                      file to write histogram information
-o OUTPUT, --output OUTPUT
                      output file
-w WEIGHT_TYPE, --weight-type WEIGHT_TYPE
                      weight type (atan(default),linear,none)
--reorder-process     apply the gaussian filter before the weight
                      function instead of after (default: weight then
                      gaussian)

-C is required when -w atan (the default weight type) is used.

OUTPUT FORMAT
#

Output data is a k-dimensional vector, written as a text file with k lines, one real number per line (via numpy.savetxt). If -o is not given, the vector is written to stdout.

If -c/--coordinates is given, the bin-center coordinates corresponding to each vector element are written to that file (also via numpy.savetxt).

If -H/--histogram-information is given, a JSON file describing the histogram binning (x-edges, y-edges, x-indices, y-indices, sign-flipped) is written. This file is required later by homcloud-view-vectorized-PD and homcloud-pict-show-volume-2d to reconstruct/interpret the vectorized histogram.