![]() |
STAG Python
2.0.2
Spectral Toolkit of Algorithms for Graphs
|
Classes | |
| class | CKNSGaussianKDE |
| A CKNS Gaussian KDE data structure. More... | |
| class | ExactGaussianKDE |
| A data structure for computing the exact Gauussian KDE. More... | |
Functions | |
| def | gaussian_kernel (float a, stag.data.DataPoint u, stag.data.DataPoint v) |
| Compute the Gaussian kernel similarity between the points u and v. | |
| float | gaussian_kernel_dist (float a, float c) |
| Compute the Gaussian kernel similarity for two points at a squared distance \(c\). | |
| def stag.kde.gaussian_kernel | ( | float | a, |
| stag.data.DataPoint | u, | ||
| stag.data.DataPoint | v | ||
| ) |
Compute the Gaussian kernel similarity between the points u and v.
Given a parameter \(a \geq 0\) and points \(u, v \in \mathbb{R}^n\), the Gaussian kernel similarity between \(u\) and \(v\) is given by
\[ k(u, v) = \exp\left( - a \|u - v\|^2_2 \right). \]
Note that the Gaussian kernel is sometimes parameterised by \(\sigma^2\), which is related to our parameter \(a\) by
\[ a = \frac{1}{\sigma^2}. \]
| a | the parameter a in the Gaussian kernel. |
| u | a data point \(u\) |
| v | a data point \(v\) |
| float stag.kde.gaussian_kernel_dist | ( | float | a, |
| float | c | ||
| ) |
Compute the Gaussian kernel similarity for two points at a squared distance \(c\).
Given a parameter \(a \geq 0\), the Gaussian kernel similarity between two points at distance \(c\) is given by
\[ \exp\left( - a c \right). \]
| a | the parameter a in the Gaussian kernel. |
| c | the squared distance between two points. |