|
| template<class Derived> |
| | GramMatrix (const Kernel &kernel, const MatrixBase< Derived > &initial_states) |
| | Compute the Gram matrix from the kernel and the initial states.
|
| |
| template<class Derived> |
| | GramMatrix (const Kernel &kernel, const MatrixBase< Derived > &initial_states, std::vector< Matrix > &gradient) |
| | Compute the Gram matrix from the kernel and the initial states.
|
| |
| template<class Derived> |
| | GramMatrix (const Kernel &kernel, const MatrixBase< Derived > &initial_states, std::vector< Matrix > *const gradient) |
| | Compute the Gram matrix from the kernel and the initial states.
|
| |
| void | compute_coefficients (const Matrix &transition_states) |
| | Given the initial state \( x \in \mathcal{X} \), compute the coefficients \( \alpha \in \mathbb{R}^n \).
|
| |
| GramMatrix & | add_diagonal_term (Scalar diagonal_term) |
| | Add a diagonal term to the Gram matrix.
|
| |
| template<class Derived> |
| Matrix | operator* (const MatrixBase< Derived > &A) const |
| | Right multiply the Gram matrix with another matrix, \( KA \).
|
| |
| template<class Derived> |
| Matrix | inverse_mult (const MatrixBase< Derived > &A) const |
| | Right multiply the inverse of the Gram matrix with another matrix, \( K^{-1}A \).
|
| |
| const Matrix & | gram_matrix () const |
| | Get read-only access to the internal matrix structure of the Gramm matrix.
|
| |
| Dimension | rows () const |
| | Get read-only access to the number of rows of the Gramm matrix.
|
| |
| Dimension | cols () const |
| | Get read-only access to the number of columns of the Gramm matrix.
|
| |
Gram Matrix obtained from a kernel function.
Given a vector space \( \texttip{\mathcal{X}}{Polish sample vector space} \) and a kernel function \( k: \mathcal{X} \times \mathcal{X} \to \mathbb{R} \), the Gram matrix is defined as the matrix \( K \in \mathbb{R}^{n \times n} \) where \( K_{ij} = k(x_i, x_j) \) or, equivalently,
\[K = \begin{bmatrix}
k(x_1, x_1) & k(x_1, x_2) & \cdots & k(x_1, x_n) \\
k(x_2, x_1) & k(x_2, x_2) & \cdots & k(x_2, x_n) \\
\vdots & \vdots & \ddots & \vdots \\
k(x_n, x_1) & k(x_n, x_2) & \cdots & k(x_n, x_n)
\end{bmatrix} .
\]
template<class Derived>
| lucid::GramMatrix::GramMatrix |
( |
const Kernel & | kernel, |
|
|
const MatrixBase< Derived > & | initial_states ) |
|
inline |
Compute the Gram matrix from the kernel and the initial states.
The initial states should be an \( \texttip{n}{Number of samples} \times \texttip{d}{Dimension of the vector space} \) matrix where \( \texttip{d}{Dimension of the vector space} \) is the dimension of the vector space \( \texttip{\mathcal{X}}{Polish sample vector space} \subseteq \mathbb{R}^d \) and \( n \) is the number of states used to compute the Gram matrix, i.e.
\[\text{initial_states} = \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix} .
\]
with \( x_i \in \mathcal{X} \) for \( 1 \le i \le s \).
- Parameters
-
| kernel | rkhs kernel used to compute the Gram matrix |
| initial_states | \( N \) initial states used to compute the Gram matrix |
template<class Derived>
| lucid::GramMatrix::GramMatrix |
( |
const Kernel & | kernel, |
|
|
const MatrixBase< Derived > & | initial_states, |
|
|
std::vector< Matrix > & | gradient ) |
|
inline |
Compute the Gram matrix from the kernel and the initial states.
The initial states should be an \( \texttip{n}{Number of samples} \times \texttip{d}{Dimension of the vector space} \) matrix where \( \texttip{d}{Dimension of the vector space} \) is the dimension of the vector space \( \texttip{\mathcal{X}}{Polish sample vector space} \subseteq \mathbb{R}^d \) and \( n \) is the number of states used to compute the Gram matrix, i.e.
\[\text{initial_states} = \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix} .
\]
with \( x_i \in \mathcal{X} \) for \( 1 \le i \le n \). Moreover, compute and store the gradient.
- Parameters
-
| kernel | rkhs kernel used to compute the Gram matrix |
| initial_states | \( N \) initial states used to compute the Gram matrix |
| [out] | gradient | gradient of the kernel with the current parameters |
template<class Derived>
| lucid::GramMatrix::GramMatrix |
( |
const Kernel & | kernel, |
|
|
const MatrixBase< Derived > & | initial_states, |
|
|
std::vector< Matrix > *const | gradient ) |
|
inline |
Compute the Gram matrix from the kernel and the initial states.
The initial states should be an \( \texttip{n}{Number of samples} \times \texttip{d}{Dimension of the vector space} \) matrix where \( \texttip{d}{Dimension of the vector space} \) is the dimension of the vector space \( \texttip{\mathcal{X}}{Polish sample vector space} \subseteq \mathbb{R}^d \) and \( n \) is the number of states used to compute the Gram matrix, i.e.
\[\text{initial_states} = \begin{bmatrix} x_1 \\ x_2 \\ \vdots \\ x_n \end{bmatrix} .
\]
with \( x_i \in \mathcal{X} \) for \( 1 \le i \le n \). Moreover, compute and store the gradient if it is not nullptr.
- Parameters
-
| kernel | rkhs kernel used to compute the Gram matrix |
| initial_states | \( N \) initial states used to compute the Gram matrix |
| [out] | gradient | gradient of the kernel with the current parameters If nullptr, the gradient will not be* computed |