Kernel Representation: Persistence Sliced Wasserstein Kernel
Source:R/representation-kernel-methods.R
PersistenceSlicedWassersteinKernel.RdComputes 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.
Super classes
rgudhi::PythonClass -> rgudhi::SKLearnClass -> rgudhi::KernelRepresentationStep -> PersistenceSlicedWassersteinKernel
Methods
Inherited methods
rgudhi::PythonClass$get_python_class()rgudhi::PythonClass$set_python_class()rgudhi::SKLearnClass$get_params()rgudhi::SKLearnClass$set_params()rgudhi::KernelRepresentationStep$apply()rgudhi::KernelRepresentationStep$fit()rgudhi::KernelRepresentationStep$fit_transform()rgudhi::KernelRepresentationStep$transform()
Method new()
The PersistenceSlicedWassersteinKernel constructor.
Usage
PersistenceSlicedWassersteinKernel$new(
num_directions = 10,
bandwidth = 1,
n_jobs = 1
)Arguments
num_directionsAn integer value specifying the number of lines evenly sampled from \([-\pi/2,\pi/2]\) in order to approximate and speed up the kernel computation. Defaults to
10L.bandwidthA numeric value specifying the bandwidth of the Gaussian kernel with which persistence diagrams will be convolved. Defaults to
1.0.n_jobsAn integer value specifying the number of jobs to use for the computation. Defaults to
1.
Examples
if (FALSE) { # reticulate::py_module_available("gudhi")
X <- seq_circle(10)
ac <- AlphaComplex$new(points = X)
st <- ac$create_simplex_tree()
dgm <- st$compute_persistence()$persistence_intervals_in_dimension(0)
ds <- DiagramSelector$new(use = TRUE)
dgm <- ds$apply(dgm)
pswk <- PersistenceSlicedWassersteinKernel$new()
pswk$apply(dgm, dgm)
pswk$fit_transform(list(dgm))
}