Matlab code to compute perturbed topological signature (PTS) from a persistence diagram (PD).
The code was developed using Matlab-2017b. However, the code should work for any version of Matlab that has the required packages installed.
-
Datasets - This folder contains PDs of WKS, HKS and SIHKS spectral descriptors computed over the SHREC 2010 3D shape dataset. The persistence diagrams are saved as .mat files. Each .mat file contains a 200x3 cell. The 200 rows correspond to the 200 shapes. The first column contains the shape's file-name, the second column contains the numerical class-label and the thrid column contains a nx1 (n = 10 or 17) cell which contains the PDs for a shape, obtained using n different spectral descriptor scales.
-
main.m - This file first extracts the PTS representations from PDs of the SHREC 2010 dataset. After extracting the PTS features, a distance matrix is generated by computing the amount of similarity/difference between the PTS features using two different Grassmannian metrics. Finally, using the computed distance matrix the 1-nearest neighbor classification accuracy is calculated. After cloning the repository, initialize the code_path variable on line 6 with the directory path leading to the main.m file.
-
Normalize_PD.m - This function normalizes the PD (passed as input) w.r.t. the largest death-time in the PD. The function assumes that the PD has the following structure [birth-time, death-time], with death-time > birth-time.
-
Random_perturbation.m - This function takes the normalized PD and parameters as input. This function generates a set of randomly perturbed PDs. Each randomly perturbed PD has its points shifted by a certain amount w.r.t. the original PD.
-
PDFs_from_PDs.m - This function takes the set of randomly perturbed PDs and parameters as input. The function generates the 2D probability density function (PDF) of the PDs using kernel density estimation.
-
map_to_Grassmannian.m - This function takes the set of 2D PDFs and parameters as input. The function maps the set of 2D PDFs to a point on the Grassmann manifold.
-
subspace_angles.m - This function computes the minimal geodesic distance between two points on the Grassmann manifold.
-
distChordalGrass.m - This function computes the chordal distance between two points on the Grassmann manifold.
-
NearestNeighbor.m - This function takes the distance matrix and labels as input and returns the one nearest neighbor classification accuracy.