Public Member Functions | |
def | __init__ (self, num_directions=10, bandwidth=1.0, n_jobs=None) |
def | fit (self, X, y=None) |
def | transform (self, X) |
def | __call__ (self, diag1, diag2) |
This is a class for computing the sliced Wasserstein kernel matrix from a list of persistence diagrams. The sliced Wasserstein kernel is computed by exponentiating the corresponding sliced Wasserstein distance with a Gaussian kernel. See http://proceedings.mlr.press/v70/carriere17a.html for more details.
def gudhi.representations.kernel_methods.SlicedWassersteinKernel.__init__ | ( | self, | |
num_directions = 10 , |
|||
bandwidth = 1.0 , |
|||
n_jobs = None |
|||
) |
Constructor for the SlicedWassersteinKernel class. Parameters: bandwidth (double): bandwidth of the Gaussian kernel applied to the sliced Wasserstein distance (default 1.). num_directions (int): number of lines evenly sampled from [-pi/2,pi/2] in order to approximate and speed up the kernel computation (default 10). n_jobs (int): number of jobs to use for the computation. See :func:`pairwise_persistence_diagram_kernels` for details.
def gudhi.representations.kernel_methods.SlicedWassersteinKernel.__call__ | ( | self, | |
diag1, | |||
diag2 | |||
) |
Apply SlicedWassersteinKernel on a single pair of persistence diagrams and outputs the result. Parameters: diag1 (n x 2 numpy array): first input persistence diagram. diag2 (n x 2 numpy array): second input persistence diagram. Returns: float: sliced Wasserstein kernel value.
def gudhi.representations.kernel_methods.SlicedWassersteinKernel.fit | ( | self, | |
X, | |||
y = None |
|||
) |
Fit the SlicedWassersteinKernel class on a list of persistence diagrams: an instance of the SlicedWassersteinDistance class is fitted on the diagrams and then stored. Parameters: X (list of n x 2 numpy arrays): input persistence diagrams. y (n x 1 array): persistence diagram labels (unused).
def gudhi.representations.kernel_methods.SlicedWassersteinKernel.transform | ( | self, | |
X | |||
) |
Compute all sliced Wasserstein kernel values between the persistence diagrams that were stored after calling the fit() method, and a given list of (possibly different) persistence diagrams. Parameters: X (list of n x 2 numpy arrays): input persistence diagrams. Returns: numpy array of shape (number of diagrams in **diagrams**) x (number of diagrams in X): matrix of pairwise sliced Wasserstein kernel values.
GUDHI Version 3.3.0 - C++ library for Topological Data Analysis (TDA) and Higher Dimensional Geometry Understanding. - Copyright : MIT | Generated on Tue Aug 11 2020 11:58:59 for GUDHI by Doxygen 1.8.18 |