Skip to content

Commit

Permalink
Merge remote-tracking branch 'origin/feature/v4_docs_review' into fea…
Browse files Browse the repository at this point in the history
…ture/v4_docs_review
  • Loading branch information
dimtsap committed Apr 7, 2022
2 parents b86a0bb + 936de13 commit 62dcf70
Show file tree
Hide file tree
Showing 3 changed files with 27 additions and 20 deletions.
17 changes: 17 additions & 0 deletions docs/source/utilities/distances/grassmann_distances.rst
Original file line number Diff line number Diff line change
@@ -1,6 +1,23 @@
Grassmann Distances
--------------------------------------

The Grassmannian (or Riemannian) distance is a metric that assigns nonnegative values to each pair of subspaces
:math:`Y_1, Y_2 \in \mathbb{R}^{n \times p}` on the Grassmann manifold :math:`\mathcal{G}(p, n)`. Formally,
is defined as the length of the shortest geodesic connecting the two points on :math:`\mathcal{G}(p, n)`.
:py:mod:`UQpy` introduces various Grassmann distances derived from the principal angles :cite:`Distances_1`.

.. math:: 0 \leq \theta_1 \leq \theta_2 \leq \ldots \leq \theta_p \leq \pi/2,

where the first principal angle :math:`\theta_1` is the smallest angle between all pairs of unit vectors in the
first and the second subspaces. Practically, the principal angles can be calculated from the singular value
decomposition (SVD) of :math:`\mathbf{Y}_1'\mathbf{Y}_2`,

.. math:: \mathbf{Y}_1'\mathbf{Y}_2 = \mathbf{U}\cos(\Theta)\mathbf{V}'

where :math:`\cos(\Theta)=\text{diag}(\cos\theta_1, \ldots,\cos\theta_p)`. This definition of distance can be extended
to cases where :math:`\mathbf{Y}_1` and :math:`\mathbf{Y}_2` have different number of columns :math:`p`. More
information can be found in :cite:`Distances_2`.

GrassmannianDistance
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

Expand Down
28 changes: 9 additions & 19 deletions docs/source/utilities/distances/index.rst
Original file line number Diff line number Diff line change
@@ -1,26 +1,14 @@
Distances
--------------------------------------

A collection of distances between points in the Euclidean space and between subspaces on the Grassmann manifold.
A collection of distance measures between points in the Euclidean space and between subspaces on the Grassmann manifold.

The Grassmannian (or Riemannian) distance is a metric that assigns nonnegative values to each pair of subspaces
:math:`Y_1, Y_2 \in \mathbb{R}^{n \times p}` on the Grassmann manifold :math:`\mathcal{G}(p, n)`. Formally,
is defined as the length of the shortest geodesic connecting the two points on :math:`\mathcal{G}(p, n)`.
:py:mod:`UQpy` introduces various Grassmann distances derived from the principal angles :cite:`Distances_1`.
Each distance function in :py:mod:`UQpy` is defined as a subclass of the :class:`.Distance` class. The
:class:`.Distance` class has two further subclasses for Euclidean distances (:class:`.EuclideanDistance`) and
Grassmann distances (:class:`.GrassmannianDistance`). Individual dsitances, depending on their type, are defined as
subclasses of these.

.. math:: 0 \leq \theta_1 \leq \theta_2 \leq \ldots \leq \theta_p \leq \pi/2,

where the first principal angle :math:`\theta_1` is the smallest angle between all pairs of unit vectors in the
first and the second subspaces. Practically, the principal angles can be calculated from the singular value
decomposition (SVD) of :math:`\mathbf{Y}_1'\mathbf{Y}_2`,

.. math:: \mathbf{Y}_1'\mathbf{Y}_2 = \mathbf{U}\cos(\Theta)\mathbf{V}'

where :math:`\cos(\Theta)=\text{diag}(\cos\theta_1, \ldots,\cos\theta_p)`. This definition of distance can be extended
to cases where :math:`\mathbf{Y}_1` and :math:`\mathbf{Y}_2` have different number of columns :math:`p`. More
information can be found in :cite:`Distances_2`.

Distance
Distance Class
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The :class:`.Distances` class is imported using the following command:
Expand All @@ -30,9 +18,11 @@ The :class:`.Distances` class is imported using the following command:
.. autoclass:: UQpy.utilities.distances.baseclass.Distance
:members:

Types of Distances
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

.. toctree::
:maxdepth: 1

Grassmannian Distances <grassmann_distances>
Euclidean Distances <euclidean_distances>
Grassmannian Distances <grassmann_distances>
2 changes: 1 addition & 1 deletion docs/source/utilities/kernels/index.rst
Original file line number Diff line number Diff line change
Expand Up @@ -12,7 +12,7 @@ Each kernel function in :py:mod:`UQpy` is defined as a subclass of the :class:`.
two further subclasses for Euclidean kernels (:class:`.EuclideanKernel`) and Grassmannian kernels
(:class:`.GrassmannianKernel`). Individual kernels, depending on their type, are defined as subclasses of these.

Kernel
Kernel Class
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^

The :class:`UQpy.utilities.kernels.baseclass.Kernel` class is imported using the following command:
Expand Down

0 comments on commit 62dcf70

Please sign in to comment.