Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

docs: reordered docs for solvers and kernels #759

Merged
merged 14 commits into from
Oct 2, 2024
Merged
2 changes: 1 addition & 1 deletion coreax/kernels/__init__.py
Original file line number Diff line number Diff line change
Expand Up @@ -39,6 +39,7 @@
from coreax.kernels.util import median_heuristic

__all__ = [
"median_heuristic",
"ScalarValuedKernel",
"UniCompositeKernel",
"PowerKernel",
Expand All @@ -47,7 +48,6 @@
"ProductKernel",
"LinearKernel",
"PolynomialKernel",
"median_heuristic",
"ExponentialKernel",
"LaplacianKernel",
"SquaredExponentialKernel",
Expand Down
30 changes: 15 additions & 15 deletions coreax/kernels/scalar_valued.py
Original file line number Diff line number Diff line change
Expand Up @@ -137,14 +137,14 @@ class ExponentialKernel(ScalarValuedKernel):
r"""
Define an exponential kernel.

Given :math:`\lambda =``length_scale` and :math:`\rho =``output_scale`, the
Given :math:`\lambda =` ``length_scale`` and :math:`\rho =` ``output_scale``, the
exponential kernel is defined as
:math:`k: \mathbb{R}^d\times \mathbb{R}^d \to \mathbb{R}`,
:math:`k(x, y) = \rho * \exp(-\frac{||x-y||}{2 \lambda^2})` where
:math:`k: \mathbb{R}^d \times \mathbb{R}^d \to \mathbb{R}`,
:math:`k(x, y) = \rho * \exp( -\frac{ ||x-y|| }{ 2 \lambda^2 } )` where
:math:`||\cdot||` is the usual :math:`L_2`-norm.

.. note::
Note that the Exponential kernel is not differentiable when :math:`x=y`.
.. warning::
The exponential kernel is not differentiable when :math:`x=y`.
tp832944 marked this conversation as resolved.
Show resolved Hide resolved

:param length_scale: Kernel smoothing/bandwidth parameter, :math:`\lambda`, must be
positive
Expand Down Expand Up @@ -497,14 +497,14 @@ class PeriodicKernel(ScalarValuedKernel):
r"""
Define a periodic kernel.

Given :math:`\lambda =``length_scale`, :math:`\rho =``output_scale`, and
:math:`\p =``periodicity`, the periodic kernel is defined as
:math:`k: \mathbb{R}^d\times \mathbb{R}^d \to \mathbb{R}`,
:math:`k(x, y) = \rho * \exp(\frac{-2 \sin^2(\pi ||x-y||/p)}{\lambda^2})` where
:math:`||\cdot||` is the usual :math:`L_2`-norm.
Given :math:`\lambda =` ``length_scale``, :math:`\rho =` ``output_scale``, and
:math:`\p =` ``periodicity``, the periodic kernel is defined as
tp832944 marked this conversation as resolved.
Show resolved Hide resolved
:math:`k: \mathbb{R}^d \times \mathbb{R}^d \to \mathbb{R}`,
:math:`k(x, y) = \rho * \exp ( \frac{ -2 \sin^2( \pi ||x-y|| / p ) }{ \lambda^2 } )`
where :math:`||\cdot||` is the usual :math:`L_2`-norm.

.. note::
Note that the Periodic kernel is not differentiable when :math:`x=y`.
.. Warning::
tp832944 marked this conversation as resolved.
Show resolved Hide resolved
The periodic kernel is not differentiable when :math:`x=y`.
tp832944 marked this conversation as resolved.
Show resolved Hide resolved

tp832944 marked this conversation as resolved.
Show resolved Hide resolved
:param length_scale: Kernel smoothing/bandwidth parameter, :math:`\lambda`, must be
positive
Expand Down Expand Up @@ -588,12 +588,12 @@ class LocallyPeriodicKernel(ProductKernel):
Define a locally periodic kernel.

The periodic kernel is defined as
:math:`k: \mathbb{R}^d\times \mathbb{R}^d \to \mathbb{R}`,
:math:`k: \mathbb{R}^d \times \mathbb{R}^d \to \mathbb{R}`,
:math:`k(x, y) = r(x,y)l(x,y)` where :math:`r` is the periodic kernel and
:math:`l` is the squared exponential kernel.

.. note::
Note that the Periodic kernel is not differentiable when :math:`x=y`.
.. Warning::
tp832944 marked this conversation as resolved.
Show resolved Hide resolved
The locally periodic kernel is not differentiable when :math:`x=y`.
tp832944 marked this conversation as resolved.
Show resolved Hide resolved

:param periodic_length_scale: Periodic kernel smoothing/bandwidth parameter
:param periodic_output_scale: Periodic kernel normalisation constant
Expand Down