diff --git a/.doctrees/api/geomstats.test.doctree b/.doctrees/api/geomstats.test.doctree index bdc1fceb1..b5afb35b9 100644 Binary files a/.doctrees/api/geomstats.test.doctree and b/.doctrees/api/geomstats.test.doctree differ diff --git a/.doctrees/environment.pickle b/.doctrees/environment.pickle index 0764097c3..dd5c028f5 100644 Binary files a/.doctrees/environment.pickle and b/.doctrees/environment.pickle differ diff --git a/.doctrees/notebooks/00_foundations__introduction_to_geomstats.doctree b/.doctrees/notebooks/00_foundations__introduction_to_geomstats.doctree index 4ac4a1e2e..824a572c1 100644 Binary files a/.doctrees/notebooks/00_foundations__introduction_to_geomstats.doctree and b/.doctrees/notebooks/00_foundations__introduction_to_geomstats.doctree differ diff --git a/.doctrees/notebooks/01_foundations__manifolds.doctree b/.doctrees/notebooks/01_foundations__manifolds.doctree index 5c2444754..1f5121c6d 100644 Binary files a/.doctrees/notebooks/01_foundations__manifolds.doctree and b/.doctrees/notebooks/01_foundations__manifolds.doctree differ diff --git a/.doctrees/notebooks/02_foundations__connection_riemannian_metric.doctree b/.doctrees/notebooks/02_foundations__connection_riemannian_metric.doctree index 1af90f6ad..bf42fd1d7 100644 Binary files a/.doctrees/notebooks/02_foundations__connection_riemannian_metric.doctree and b/.doctrees/notebooks/02_foundations__connection_riemannian_metric.doctree differ diff --git a/.doctrees/notebooks/11_real_world_applications__cell_shapes_analysis.doctree b/.doctrees/notebooks/11_real_world_applications__cell_shapes_analysis.doctree index fdf6560bb..641038f6b 100644 Binary files a/.doctrees/notebooks/11_real_world_applications__cell_shapes_analysis.doctree and b/.doctrees/notebooks/11_real_world_applications__cell_shapes_analysis.doctree differ diff --git a/.doctrees/notebooks/12_real_world_applications__emg_sign_classification_in_spd_manifold.doctree b/.doctrees/notebooks/12_real_world_applications__emg_sign_classification_in_spd_manifold.doctree index 6f02206b9..e71713f63 100644 Binary files a/.doctrees/notebooks/12_real_world_applications__emg_sign_classification_in_spd_manifold.doctree and b/.doctrees/notebooks/12_real_world_applications__emg_sign_classification_in_spd_manifold.doctree differ diff --git a/.doctrees/notebooks/13_real_world_applications__graph_embedding_and_clustering_in_hyperbolic_space.doctree b/.doctrees/notebooks/13_real_world_applications__graph_embedding_and_clustering_in_hyperbolic_space.doctree index a75649f02..2e4a182d0 100644 Binary files a/.doctrees/notebooks/13_real_world_applications__graph_embedding_and_clustering_in_hyperbolic_space.doctree and b/.doctrees/notebooks/13_real_world_applications__graph_embedding_and_clustering_in_hyperbolic_space.doctree differ diff --git a/.doctrees/notebooks/14_real_world_applications__hand_poses_analysis_in_kendall_shape_space.doctree b/.doctrees/notebooks/14_real_world_applications__hand_poses_analysis_in_kendall_shape_space.doctree index bf608e334..f7de07ed5 100644 Binary files a/.doctrees/notebooks/14_real_world_applications__hand_poses_analysis_in_kendall_shape_space.doctree and b/.doctrees/notebooks/14_real_world_applications__hand_poses_analysis_in_kendall_shape_space.doctree differ diff --git a/.doctrees/notebooks/15_real_world_applications__optic_nerve_heads_analysis_in_kendall_shape_space.doctree b/.doctrees/notebooks/15_real_world_applications__optic_nerve_heads_analysis_in_kendall_shape_space.doctree index 9eb99d8b0..1e6286c05 100644 Binary files a/.doctrees/notebooks/15_real_world_applications__optic_nerve_heads_analysis_in_kendall_shape_space.doctree and b/.doctrees/notebooks/15_real_world_applications__optic_nerve_heads_analysis_in_kendall_shape_space.doctree differ diff --git a/.doctrees/notebooks/17_foundations__stratified_spaces.doctree b/.doctrees/notebooks/17_foundations__stratified_spaces.doctree index 82b3346ca..42211cf3e 100644 Binary files a/.doctrees/notebooks/17_foundations__stratified_spaces.doctree and b/.doctrees/notebooks/17_foundations__stratified_spaces.doctree differ diff --git a/.doctrees/notebooks/18_real_world_applications__sao_paulo_traffic_optimization.doctree b/.doctrees/notebooks/18_real_world_applications__sao_paulo_traffic_optimization.doctree index 4f9ed07b7..039bd00c8 100644 Binary files a/.doctrees/notebooks/18_real_world_applications__sao_paulo_traffic_optimization.doctree and b/.doctrees/notebooks/18_real_world_applications__sao_paulo_traffic_optimization.doctree differ diff --git a/_modules/geomstats/algebra_utils.html b/_modules/geomstats/algebra_utils.html index 07a937e82..58e6c0aac 100644 --- a/_modules/geomstats/algebra_utils.html +++ b/_modules/geomstats/algebra_utils.html @@ -45,7 +45,7 @@ - + diff --git a/_modules/geomstats/datasets/prepare_emg_data.html b/_modules/geomstats/datasets/prepare_emg_data.html index 9153909c1..b88c8aca0 100644 --- a/_modules/geomstats/datasets/prepare_emg_data.html +++ b/_modules/geomstats/datasets/prepare_emg_data.html @@ -45,7 +45,7 @@ - + diff --git a/_modules/geomstats/datasets/prepare_graph_data.html b/_modules/geomstats/datasets/prepare_graph_data.html index 135ccd669..b0a4e8cda 100644 --- a/_modules/geomstats/datasets/prepare_graph_data.html +++ b/_modules/geomstats/datasets/prepare_graph_data.html @@ -45,7 +45,7 @@ - + diff --git a/_modules/geomstats/datasets/utils.html b/_modules/geomstats/datasets/utils.html index 52ed98d15..308bba780 100644 --- a/_modules/geomstats/datasets/utils.html +++ b/_modules/geomstats/datasets/utils.html @@ -45,7 +45,7 @@ - + diff --git a/_modules/geomstats/distributions/lognormal.html b/_modules/geomstats/distributions/lognormal.html index 85753c41d..75e67b821 100644 --- a/_modules/geomstats/distributions/lognormal.html +++ b/_modules/geomstats/distributions/lognormal.html @@ -45,7 +45,7 @@ - + diff --git a/_modules/geomstats/errors.html b/_modules/geomstats/errors.html index 35c3eb0cb..2f2513b32 100644 --- a/_modules/geomstats/errors.html +++ b/_modules/geomstats/errors.html @@ -45,7 +45,7 @@ - + diff --git a/_modules/geomstats/exceptions.html b/_modules/geomstats/exceptions.html index 67aa640c3..9eac7eb03 100644 --- a/_modules/geomstats/exceptions.html +++ b/_modules/geomstats/exceptions.html @@ -45,7 +45,7 @@ - + diff --git a/_modules/geomstats/geometry/base.html b/_modules/geomstats/geometry/base.html index 31461016a..4c6635fc7 100644 --- a/_modules/geomstats/geometry/base.html +++ b/_modules/geomstats/geometry/base.html @@ -45,7 +45,7 @@ - + diff --git a/_modules/geomstats/geometry/complex_manifold.html b/_modules/geomstats/geometry/complex_manifold.html index b19d2bbac..689520fc4 100644 --- a/_modules/geomstats/geometry/complex_manifold.html +++ b/_modules/geomstats/geometry/complex_manifold.html @@ -45,7 +45,7 @@ - + diff --git a/_modules/geomstats/geometry/complex_matrices.html b/_modules/geomstats/geometry/complex_matrices.html index c4652ebcc..e53c78807 100644 --- a/_modules/geomstats/geometry/complex_matrices.html +++ b/_modules/geomstats/geometry/complex_matrices.html @@ -45,7 +45,7 @@ - + diff --git a/_modules/geomstats/geometry/complex_poincare_disk.html b/_modules/geomstats/geometry/complex_poincare_disk.html index 73d095c19..48db180d5 100644 --- a/_modules/geomstats/geometry/complex_poincare_disk.html +++ b/_modules/geomstats/geometry/complex_poincare_disk.html @@ -45,7 +45,7 @@ - + diff --git a/_modules/geomstats/geometry/complex_riemannian_metric.html b/_modules/geomstats/geometry/complex_riemannian_metric.html index e39df7f05..dfa9f20ca 100644 --- a/_modules/geomstats/geometry/complex_riemannian_metric.html +++ b/_modules/geomstats/geometry/complex_riemannian_metric.html @@ -45,7 +45,7 @@ - + diff --git a/_modules/geomstats/geometry/connection.html b/_modules/geomstats/geometry/connection.html index d2f97f0a2..34686523a 100644 --- a/_modules/geomstats/geometry/connection.html +++ b/_modules/geomstats/geometry/connection.html @@ -45,7 +45,7 @@ - + diff --git a/_modules/geomstats/geometry/diffeo.html b/_modules/geomstats/geometry/diffeo.html index 49ab88560..fda302d05 100644 --- a/_modules/geomstats/geometry/diffeo.html +++ b/_modules/geomstats/geometry/diffeo.html @@ -45,7 +45,7 @@ - + diff --git a/_modules/geomstats/geometry/discrete_curves.html b/_modules/geomstats/geometry/discrete_curves.html index 8186e7a53..a5cdd01b3 100644 --- a/_modules/geomstats/geometry/discrete_curves.html +++ b/_modules/geomstats/geometry/discrete_curves.html @@ -45,7 +45,7 @@ - + @@ -795,7 +795,7 @@
Many data sets lie on a manifold. The definition of manifold will be introduced later, but for now we can think of a manifold as being something like a surface, such as the surface (2-dimensional sphere) in the figure below.
- +Analyzing data that lie on manifolds is often possible without Riemannian Geometry, but choosing to analyze data on manifolds is advantageous for three reasons:
Analyzing data on the manifold it lies on allows you to reduce the degrees of freedom of the system, which makes computations less complicated and more intuitive and interpretable.
The number of \(\textbf{Degrees of Freedom}\) a system has is equivalent to the number of variables needed to describe the system completely. For example, an object moving freely in three dimensions will require three variables to describe it completely \((x,y,z)\); or \((\phi,\theta, r)\) in spherical coordinates- see Figure (a), below. However, if you know that the point lies on the surface of a sphere of known radius, then you would only need to use two variables, \((\theta,\phi)\), to specify its position- see Figure (b), below.
Knowing that the point lies on the surface of a manifold (a sphere) allows us to use fewer variables to record its location, which is computationally more efficient in terms of memory requirements, and less mentally taxing (if you are solving a problem on paper).
- +Reducing the number of variables is one of the major motivations behind using manifolds to analyze data. Of course, it is sometimes possible to analyze data without manifolds and Riemannian Geometry, but this will be more complicated and computationally intensive.
Objects travelling along a manifold often follow geodesics on that manifold. When the manifold is equipped with a so-called “Riemannian metric” (which will be introduced in a later notebook), we can define geodesics on the manifold. The geodesic is the path of shortest distance that a particle can travel in the space that it is in. For example, geodesics in 2D and 3D space are straight lines are the shortest way to get from one point to another. The figure below shows paths between two points in cartesian space. One path (\(\gamma\)) is a geodesic in cartesian coordinates, and the other path (\(\gamma^{'}\)) is not a geodesic. Figure (a) shows this in 2D, and Figure (b) shows this in 3D.
- +However, when an object lies in a higher dimensional curved space, its geodesic will not follow a straight line. For example, if an object is constrained to move along the surface of a sphere, the shortest path between points is not a straight line, but rather, a curve. A straight line in 3D space would not lie on the surface of a sphere, so it cannot be the shortest path along the sphere. The figure below shows \(\gamma\), which is a geodesic on the sphere, along with \(\gamma^{'}\), which is not a geodesic on the sphere.
- +If you did not know that the object was moving along the surface of the sphere, you would wonder why it is taking such an “irratic” path instead of just going straight. The motion of the particles in your system might seem random because you do not understand the space they are moving in. However, if you learn more about the space they are moving in (the surface of a sphere), you would realize that the particles are following very reasonable and predictable paths along geodesics, and this would give you \(\textit{not only}\) a better understanding of how particles have moved in the past but \(\textit{also}\) predictive power to determine how particles will move in the future.
Let’s begin with a simpler example in cartesian coordinates. Let’s say that you are measuring the position of a car moving at constant velocity, but you dropped your position-measuring-device after only one measurement, and your data looks like this:
- +How can you get any information from this? It would be very difficult to get information from this if you don’t have an exact model for what the data \(\textit{should}\) look like. Luckily, it is well known that objects moving with constant velocity \(v\) can be modelled by the equation \(x_f = x_i + v\Delta t\), so even though you do not have many data points, you will still be able to accurately predict your car’s future position. However, if you did not know that your data should follow a straight line such as in Figure (c) or Figure (d), or you did not know the car’s velocity v such as in Figure (b), then you might try to fit the data using incorrect models, and your (incorrect) model would not be able to accurately predict the car’s future position.
In the following figure, the green point in each graph shows the single measured point (the car’s only measured position), and the purple points show future points (the car’s future positions). Note that we are only able to accurately predict future points with a correct model.
- +Similarly, knowing the exact manifold your data lies on can help you analyze your current data points and predict future data. For example, let’s say that your data lives on a 2-dimensional sphere, as shown below.
- +If you did not know that your data live on the surface of a sphere or you did not, then you might try to fit your data with a line (such as in Figure (b) below) instead of using Geomstats to analyze your data, which appears to follow a geodesic curve on a sphere (shown in Figure (a) below).
- +\(\textbf{A note about Geomstat's current capabilities:}\)
Our current version of Geomstats cannot tell you \(\textit{which}\) manifold your data lives on, and it also cannot perform “manifold fitting” (adjusting the general parameters of a manifold to fit your data set). For example, Geomstats cannot tell you if your data lives on the surface of a sphere, and if you \(\textit{know}\) that your data falls on the surface of a sphere, Geomstats cannot tell you what the radius of that sphere is.
However, if you \(\textit{know}\) the exact manifold that your data lives on (e.g. you know that your data lives on a sphere of radius R=3), then you can \(\textit{use}\) Geomstats to unlock the predictive power that differential geometry can provide you.
@@ -540,7 +540,7 @@In the next notebook, we will discuss the Manifold class.
The figure below provides a visualization of each of these definitions. The first figure is a visualization of “local parametrization”, the second is a visualization of “local implicit function” and the third is a visualization of “local graph”:
- - + +Each one of these definitions of a manifold is important because each one gives us an additional way to describe a manifold. This is useful because some manifolds are much easier described (or computationally implemented) by one of these definitions than the others. For example, any three of these definitions can be used to describe a hypersphere, but a hypersphere is most easily implemented using definition (2).
A hypersphere is one type of manifold, but there are many other types of manifolds that are commonly used and seen in nature. We will show a few examples here to help you build intuition about what a manifold is and what a manifold can look like.
For example, a torus (the surface of a donut) is a manifold.
- +A klein bottle (the surface of the shape shown below) is also a manifold.
- +Perhaps a more familiar example for those in physics: Minkowski space (or Minkowski spacetime) is a combination of three-dimensional Euclidean space and time into a four-dimensional manifold (where x, y, z, and time are the dimensions of the space). This manifold is theorized to take one of three forms. A 4-dimensional manifold of: (a) flat curvature, (b) positive curvature, or (c) negative curvature.
- +\(\textbf{Manifolds are important because data in nature "naturally falls on manifolds"}\), and as we discussed in the introduction section, knowing the manifold that a data set belongs to may give you more predictive power and a better understanding of the data’s evolution.
\(\textbf{What does it mean for data to "naturally fall on a manifold"?}\) In nature, data are often subject to constraints, and these constraints force the data to lie on manifolds. For example, consider the position of cities on the earth.
- +The cities are subject to the following constraints: 1) they cannot fly above the surface of the earth because gravity holds them down and 2) they cannot sink down into the earth because the surface of the earth holds them up. Therefore, they are constrained to move (or not move) on the surface of a 3-dimensional sphere. This space that they are confined to exist in should sound familiar– it is the space of a 2-dimensional hypersphere!
Other data falls on manifolds in similar ways: the data is subject to certain constraints, which forces it to fall on a manifold.
#
Here we will provide a brief reminder of tangent vectors as a way to lay the groundwork for discussing tangent spaces.
A \(\textbf{tangent vector}\) is a vector that is “tangent” to a curve or surface at a given point. When a vector is “tangent” to a curve, this means that the vector has the same slope as the curve does at that point.
- +Now we will introduce the concept of a “tangent space”. The tangent space at a certain point on a manifold is comprised of all of the possible tangent vectors that exist at that point. For example, if you are considering the tangent space on a curve, then the only possible tangent vectors are tangent vectors that point forward and backward along the line (a). However, if you are considering the tangent space at a point on a surface, then the tangent vectors can point forward, backward, left, right, and everywhere in between, and the set of all tangent vectors forms a plane (b).
- +Thus, the tangent space of a 1-dimensional manifold (curve) is also one dimensional, and the tangent space of a 2-dimensional manifold (a 2-dimensional surface) is also 2-dimensional.
Similarly, for every n-dimensional manifold, there exists an n-dimensional tangent space at each point on the manifold, and the tangent space is comprised of all possible tangent vectors on that manifold.
Manifold
class structured?#The hierarchical structure of the classes inheriting from the Manifold
parent class is as follows (this Figure is a courtesy of Nicolas Guigui):
As discussed in the previous section, one of the primary purposes of the Manifold
class is to hold information about various types of manifolds. Rules that are universally true for all manifolds are implemented in methods in the parent class Manifold
. Rules that are true for some types of manifolds are implemented in the subclasses of Manifold
: LevelSet
, VectorSpaceOpenSet
, FiberBundle
, ProductManifold
, VectorSpace
, MatrixLieAlgebra
, and MatrixLieGroup
.
Specific types of manifolds are described in methods within these subclasses.
In this notebook, we will focus on describing the subclasses pertinent to the geometry module of geomstats: LevelSet
, VectorSpaceOpenSet
, ProductManifold
and VectorSpace
.
VectorSpace
5.2.1 What is an Open Set?#
Intuitively, an open set is a group of numbers that does not include points on the boundary of whatever they are describing. For example, if you were to take the set of all points between a and b but \(\textbf{not}\) include the values a and b, this would be an open set (shown in figure a). If you were to take the set of all points between a and b and include the values a and b, this would be a closed set (shown in figure b)
-
+
The above examples showed open and closed sets in one dimension. Similarly, in two dimensions, open sets can be defined as sets which do not contain their boundaries. For example, the inside of the sphere, i.e. the ball without its boundary, is a manifold that is an open set. The image below shows an example of an open set (a) and a closed set (b) in two dimensions.
-
+
5.2.2 What Methods are Implemented in VectorSpaceOpenSet
?#
@@ -1061,7 +1061,7 @@ 5.3.1 What is a Level Set?\(\textbf{Level Sets}\)
. A level set is the set of values \(x\) for which a function f(x) is equal to a given constant. In other words, a level set is a set of curves for which the function describing a manifold is constant along that curve.
In the same way that VectorSpaceOpenSet
is an implementation of the first definition of a manifold (Local Parametrization), LevelSet
is an implementation of the second definition of a manifold (Local Implicit Function). a level set is a set of points for which the function \(f\) takes the exact same value. This value is called the “level”, and does not need to be a scalar, it could also be a vector.
For example, consider a hypersphere in three dimensional space. Each of the concentric spheres is a 2-dimensional manifold, each corresponding to a different level \((r1, r2,r3)\).
-
+
You can see here that the subclass Hypersphere
is indeed implemented as a LevelSet
.
diff --git a/notebooks/02_foundations__connection_riemannian_metric.html b/notebooks/02_foundations__connection_riemannian_metric.html
index 02d5dbb24..484bc0251 100644
--- a/notebooks/02_foundations__connection_riemannian_metric.html
+++ b/notebooks/02_foundations__connection_riemannian_metric.html
@@ -51,7 +51,7 @@
-
+
@@ -485,7 +485,7 @@
Discuss the RiemannianMetric subclass of the Connection Class
This notebook provides an overview of the \(\textbf{Connection}\) class in Geomstats. Intuitively: a connection is a mathematical operator that tells you how much a vector will change when you move it along a manifold in the direction of another vector. The symbol for connection is \(\nabla\), and \(\nabla_{\vec{u}} \vec{v}\) denotes how much vector \(\vec{v}\) would change if you moved it an infinitesimal distance in the direction of vector \(\vec{u}\) (see figure below).
-
+
1. What is a Connection?#
We will start by defining the connection \(\textit{mathematically}\), and then we will define the connection again in a more \(\textit{conceptual and intuitive}\) way with examples.
@@ -501,7 +501,7 @@ 1.1 General Mathematical Definition of the Connection“\(\nabla:\)” - this part is saying that it is the connection (denoted \(\nabla\)) that is performing the transformation.
“\(T M\)” - this symbolizes the \(\textbf{tangent bundle}\) of the manifold \(M\). A tangent bundle is the collection of all tangent spaces on the manifold \(M\). A tangent bundle is itself also a manifold.
“\(\Gamma(T M)\)” - \(\Gamma(T M)\) denotes the space of vector fields. A single element of \(\Gamma(T M)\) is a single vector field on the manifold \(M\). A vector field is comprised of a set of vectors on the manifold, where there is a vector at each point, and that vector is an element of the tangent space at that point (shown below).
-
+
Putting all of this together, \(\nabla: \Gamma (T M) \times \Gamma (T M) \to \Gamma (T M)\) is simply saying that the connection is a transformation which takes two arguments, both of which are vector fields (comprised of tangent vectors), and the result of the transformation is another vector field (comprised of tangent vectors).
\(\textbf{2. Now, let's consider the conditions that the connection must satisfy.}\) 1. (linearity of the \(1^{st}\) argument): \(\nabla_{f X} Y = f \nabla_{X} Y\)
@@ -513,15 +513,15 @@ 1.1 General Mathematical Definition of the Connection
1.2 What does the Connection actually do? – a more friendly description of the connection, with an example#
Consider a single vector \(\vec{a_p}\), tangent to the manifold at point \(p\) (shown in the figure below).
-
+
Now, suppose you want to see what vector \(\vec{a_p}\) looks like when it is translated to a different point on the manifold. You may be asking why we are placing importance on this question– because for a vector in cartesian coordinates, this question would be trivial. If you translated vector \(\vec{a_p}\) to a different point in cartesian coordinates, the vector itself would not change (as shown in the figure below).
-
+
A spatially translated vector in cartesian coordinates does not change because the basis vectors in cartesian coordinates are translationally invariant, meaning all points in cartesian coordinates have the same set of basis vectors.
This is not, however, necessarily true for points on a manifold– if you move a tangent vector from one point to another (i.e. from one tangent space to another), the vector will not necessarily look the same after this transformation. (The figure below shows that when \(\vec{a_p}\) is translated to a different point on the manifold, it could be pointing in a direction different from its original direction.)
-
+
This is why the connection is such an important concept as we analyze data on manifolds. The connection helps us quantify how much a vector will change when we move it from one point to another on a manifold.
More specifically, the connection is able to tell us how one vector will change if it is moved in the direction of another vector. For example, if vectors \(\vec{a}\) and \(\vec{b}\) exist in the same tangent plane, then the connection \(\nabla_{\vec{b}} \vec{a}\) tells us how much the vector \(\vec{a}\) will change if it is moved an infinitesimally small distance in the direction of \(\vec{b}\) (shown in the figure below).
-
+
@@ -547,7 +547,7 @@ 2.1 Parallel Vector Fields\(\textbf{X}\) infinitesimally along the curve \(\gamma\) in the direction of \(\gamma\)’s tangent vector \(\dot{\gamma}\), the vector field \(\textbf{X}\) would not change. Note that this means that in differential geometry, we can only define the term “parallel” when we define it \(\textit{along a curve}\). The figure below shows that at each point \(t\) along the curve \(\gamma\), the vector
field satisfies \(\nabla_{\dot{\gamma}(t)} X(t)=0\), which means that the vector field shown in pink is a parallel vector field.
-
+
2.2 Parallel Transport#
@@ -555,7 +555,7 @@ 2.2 Parallel Transport\(T_{\gamma(a)}M\)) to another tangent space (\(T_{\gamma(s)}M\)).
Conceptually, this is exactly like solving a differential equation: we can find a “solution” (in this case: the transported vector) to the equation \(\nabla_{\dot \gamma(t)} X(\gamma(t)) = 0\) if we are given initial conditions (in this case: an initial point and tangent vector). Note that \(X(\gamma(t))\) in the differential equation simply indicates that the vector field \(X\) is parallel along the curve \(\gamma(t)\). In other words, the parallel transport calculates the
parallel vector field along the curve \(\gamma(t)\) and then selects the element of the vector field that lies at the final point \(\gamma(s)\). The figure below shows this process.
-
+
Note that the connection was able to tell us how a vector would change infinitesimally if we move a vector in the direction of another vector, but here, we are able to use parallel transport to calculate how a vector will change if it is translated a \(\textbf{non-infinitesimal}\) distance.
@@ -577,7 +577,7 @@ 3.3 Building Intuition with Physics\(\textit{four-dimensional}\) “fabric” that makes up the universe, and it is a manifold. Spacetime curves around masses (like planets, stars, black holes), which means that in those areas, we cannot approximate the space as being Euclidean. It
is in these spaces that we must use geodesics to predict the paths that objects will follow– because free particles (and light) follow geodesics in space.
In fact, telescopes have confirmed that light bends around very massive objects like black holes (shown below).
-
+
This is just one example of why geodesics are crucial to understanding real-world data. Other examples exist in areas like biophysics where the trajectory of cells along a manifold may follow geodesics.
@@ -590,7 +590,7 @@ 4. Description of Connection in Local Coordinates (using Christoffel Symbols
4.1 Math Notation: \(\mathbf{ \partial_i}\) Basis Vector#
\({\partial_i}\) is equivalent to \(\vec{e}_i\). For example, in three dimensions, one could express the basis vectors \(\hat{x}, \hat{y}, \hat{z}\) as either \(\vec{e}_x, \vec{e}_y, \vec{e}_z\) or as \(\partial_x, \partial_y, \partial_z\).
-
+
Note/practicality: basis vectors on a manifold may differ at each point, which means that basis vectors are actually dependent on the tangent space \(T_pM\) to which they belong. Thus, we “should” be writing \(\vec{e}_i(p)\), but in practice, the point \(p\) is omitted.
@@ -629,27 +629,27 @@ 5. Additional Important Mathematical concepts utilized by
Exponentials on Manifolds#
In Euclidean space, \(\textit{addition}\) is a tool which takes two points \(p_1, p_2\), “adds” them, and generates a third, larger point \(p_3\) (as shown in the figure below). Addition gives us a way to “move forward” in Euclidean space.
-
+
On manifolds, the \(\textit{exponential}\) provides a tool which “takes the exponential of the tangent vector at point \(p\)” to generate a third point on the manifold. The exponential does this by 1) identifying the unique geodesic \(\gamma\) that goes through \(p\) and \(v_p\), 2) identifying the “length” \(l\) of the tangent vector \(v_p\), and 3) calculating another point \(p'\) along \(\gamma(t)\) that is a “distance” \(l\) from the initial point
\(p\) (see figure below). Note again that the notion of “length” and “distance” is different on a manifold than it is in Euclidean space and that quantifying length is not something that we will be able to do without specifying a metric (discussed in RiemannianMetric
section).
-
+
The exponential is often described as being the “differential geometry version” of addition.
Logarithms on Manifolds#
In Euclidean space, \(\textit{subtraction}\) is an operation which allows us to take the third point \(p_3\) and one of the initial points \(p_1\) and extract the other initial point \(p_2\) (as shown in the figure below).
-
+
Similarly, the \(\textit{logarithm}\) allows us to take the final point \(p'\) and the initial point \(p\) to extract the tangent vector \(v_p\) at the initial point. The logarithm is able to do this by 1) identifying the unique geodesic \(\gamma\) that connects the two points 2) calculating the “length” of that geodesic 3) generating the unique tangent vector at \(p\), with a “length” equal to that of the geodesic (shown in the figure below). Again, remember that
“length” is not something that we can quantify without specifying a metric, which we will not be able to do until the RiemannianMetric
section.
A key point here is that if you know a point and a tangent vector at that point, you can calculate a unique geodesic that goes through that point, and similarly, if you know the point and geodesic, you should be able to extract the unique tangent vector that produced that geodesic.
-
+
The logarithm is the inverse map of the exponential and is often described as being the “differential geometry version” of subtraction.
6. Geomstats Documentation: The Connection
Class#
The Connection
class in geomstats has four methods and one subclass, whose structure is shown below:
-
+
The methods of the Connection
class also equip the RiemannianMetric
subclass with the tools it needs to perform calculations on manifolds (we will discuss the RiemannianMetric
class later in this notebook).
We will first print the key methods of the Connection
class, and then at the end we will print the entire connection class for anyone who is interested.
@@ -1670,7 +1670,7 @@ 7.2 How is the Riemannian Metric Connected with the Connection?
7.3 RiemannianMetric
in Geomstats
#
The RiemannianMetric
subclass is the class that actually performs calculations on manifolds. This is because we cannot perform “general” calculations like logarithm, exponential, parallel transport, and calculating geodesics without first being equip with a metric. The RiemannianMetric
subclass contains a collection of metrics that Geomstats
users may use to perform calculations on manifolds. The structure of the RiemannianMetric
class is shown below.
-
+
In [7]:
diff --git a/notebooks/03_practical_methods__data_on_manifolds.html b/notebooks/03_practical_methods__data_on_manifolds.html
index 8dcc2d9f8..799b2ae9d 100644
--- a/notebooks/03_practical_methods__data_on_manifolds.html
+++ b/notebooks/03_practical_methods__data_on_manifolds.html
@@ -51,7 +51,7 @@
-
+
diff --git a/notebooks/04_practical_methods__from_vector_spaces_to_manifolds.html b/notebooks/04_practical_methods__from_vector_spaces_to_manifolds.html
index 5f7373280..945291fd2 100644
--- a/notebooks/04_practical_methods__from_vector_spaces_to_manifolds.html
+++ b/notebooks/04_practical_methods__from_vector_spaces_to_manifolds.html
@@ -51,7 +51,7 @@
-
+
diff --git a/notebooks/05_practical_methods__simple_machine_learning_on_tangent_spaces.html b/notebooks/05_practical_methods__simple_machine_learning_on_tangent_spaces.html
index 4276f65df..ce60b0ebb 100644
--- a/notebooks/05_practical_methods__simple_machine_learning_on_tangent_spaces.html
+++ b/notebooks/05_practical_methods__simple_machine_learning_on_tangent_spaces.html
@@ -51,7 +51,7 @@
-
+
diff --git a/notebooks/06_practical_methods__riemannian_frechet_mean_and_tangent_pca.html b/notebooks/06_practical_methods__riemannian_frechet_mean_and_tangent_pca.html
index bcc94b070..6ee7d4a73 100644
--- a/notebooks/06_practical_methods__riemannian_frechet_mean_and_tangent_pca.html
+++ b/notebooks/06_practical_methods__riemannian_frechet_mean_and_tangent_pca.html
@@ -51,7 +51,7 @@
-
+
diff --git a/notebooks/07_practical_methods__riemannian_kmeans.html b/notebooks/07_practical_methods__riemannian_kmeans.html
index 75e1598b6..d6b5391d0 100644
--- a/notebooks/07_practical_methods__riemannian_kmeans.html
+++ b/notebooks/07_practical_methods__riemannian_kmeans.html
@@ -51,7 +51,7 @@
-
+
diff --git a/notebooks/08_practical_methods__information_geometry.html b/notebooks/08_practical_methods__information_geometry.html
index 2b6c9e0dc..91452ef2b 100644
--- a/notebooks/08_practical_methods__information_geometry.html
+++ b/notebooks/08_practical_methods__information_geometry.html
@@ -51,7 +51,7 @@
-
+
diff --git a/notebooks/09_practical_methods__implement_your_own_riemannian_geometry.html b/notebooks/09_practical_methods__implement_your_own_riemannian_geometry.html
index 26012ebcc..2bbad6f74 100644
--- a/notebooks/09_practical_methods__implement_your_own_riemannian_geometry.html
+++ b/notebooks/09_practical_methods__implement_your_own_riemannian_geometry.html
@@ -51,7 +51,7 @@
-
+
diff --git a/notebooks/10_practical_methods__shape_analysis.html b/notebooks/10_practical_methods__shape_analysis.html
index d95778de3..cbcf2af76 100644
--- a/notebooks/10_practical_methods__shape_analysis.html
+++ b/notebooks/10_practical_methods__shape_analysis.html
@@ -51,7 +51,7 @@
-
+
diff --git a/notebooks/11_real_world_applications__cell_shapes_analysis.html b/notebooks/11_real_world_applications__cell_shapes_analysis.html
index 644dab932..7693b5863 100644
--- a/notebooks/11_real_world_applications__cell_shapes_analysis.html
+++ b/notebooks/11_real_world_applications__cell_shapes_analysis.html
@@ -51,7 +51,7 @@
-
+
@@ -496,7 +496,7 @@ Shape Analysis of Cancer CellsICLR 2021 Computational Geometry and Topology challenge.
-
+
Figure 1: Representative images of the cell lines using fluorescence microscopy, studied in this notebook (Image credit : Ashok Prasad). The cells nuclei (blue), the actin cytoskeleton (green) and the lipid membrane (red) of each cell are stained and colored. We only focus on the cell shape in our analysis.
@@ -530,7 +530,7 @@ 2. Dataset DescriptionWe study a dataset of mouse Osteosarcoma imaged cells (AXCFP2019). The dataset contains two different cancer cell lines : DLM8 and DUNN, respectively representing a more agressive and a less agressive cancer. Among these cells, some have also been treated with different single drugs that perturb the cellular cytoskeleton. Overall, we can label each cell according to their cell line (DLM8 and DUNN), and also if it is a control cell (no treatment), or has been treated
with one of the following drugs : Jasp (jasplakinolide) and Cytd (cytochalasin D).
Each cell comes from a raw image containing a set of cells, which was thresholded to generate binarized images.
-
+
After binarizing the images, contouring was used to isolate each cell, and to extract their boundaries as a counter-clockwise ordered list of 2D coordinates, which corresponds to the representation of discrete curve in Geomstats. We load these discrete curves into the notebook.
In [2]:
diff --git a/notebooks/12_real_world_applications__emg_sign_classification_in_spd_manifold.html b/notebooks/12_real_world_applications__emg_sign_classification_in_spd_manifold.html
index 4bb93ce09..4aac5de51 100644
--- a/notebooks/12_real_world_applications__emg_sign_classification_in_spd_manifold.html
+++ b/notebooks/12_real_world_applications__emg_sign_classification_in_spd_manifold.html
@@ -51,7 +51,7 @@
-
+
@@ -499,7 +499,7 @@ Hand gesture classification with EMG data using Riemannian metrics
+
Context#
The data are acquired from somOS-interface: an sEMG armband that allows you to interact via bluetooth with an Android smartphone (you can contact Marius Guerard (marius.guerard@gmail.com) or Renaud Renault (renaud.armand.renault@gmail.com) for more info on how to make this kind of armband yourself).
diff --git a/notebooks/13_real_world_applications__graph_embedding_and_clustering_in_hyperbolic_space.html b/notebooks/13_real_world_applications__graph_embedding_and_clustering_in_hyperbolic_space.html
index 66ed97689..d2ef7e35d 100644
--- a/notebooks/13_real_world_applications__graph_embedding_and_clustering_in_hyperbolic_space.html
+++ b/notebooks/13_real_world_applications__graph_embedding_and_clustering_in_hyperbolic_space.html
@@ -51,7 +51,7 @@
-
+
@@ -572,7 +572,7 @@ Parameters and Initialization Some information about the dataset is displayed to provide insight into its
+
The Zachary karate club network was collected from the members of a university karate club by Wayne Zachary in 1977. Each node represents a member of the club, and each edge represents an undirected relation between two members. An often discussed problem using this dataset is to find the two groups of people into which the karate club split after an argument between two teachers. Some information about the dataset is displayed to provide insight into its
complexity.
In [3]:
@@ -598,7 +598,7 @@ Parameters and Initialization\(V\) as the set of nodes and \(E \subset V\times V\) the set of edges. The goal of embedding GSD is to provide a faithful and exploitable representation of the graph structure. It is mainly achieved by preserving first-order proximity that enforces nodes sharing edges to be close to each other. It can additionally preserve second-order proximity that enforces two nodes sharing the same context (i.e., nodes that share neighbors but are not necessarily directly connected) to be
close. Let \(\mathbb{B}^m\) be the Poincaré Ball of dimension \(m\) equipped with the distance function \(d\). The below figure shows geodesics between pairs of points on \(\mathbb{B}^2\). Geodesics are the shortest path between two points. The distance function \(d\) of two points is the length of the geodesic that links them.
-
+
Declaring an instance of the PoincareBall
manifold of two dimensions in geomstats
is straightforward:
In [4]:
@@ -616,7 +616,7 @@ Loss function.
\[\mathcal{L} = - \sum_{v_i\in V} \sum_{v_j \in C_i} \bigg[ log(\sigma(-d^2(\phi_i, \phi_j'))) + \sum_{v_k\sim \mathcal{P}_n} log(\sigma(d^2(\phi_i, \phi_k'))) \bigg]\]
where \(\sigma(x)=\frac{1}{1+e^{-x}}\) is the sigmoid function and \(\phi_i \in \mathbb{B}^m\) is the embedding of the \(i\)-th node of \(V\), \(C_i\) the nodes in the context of the \(i\)-th node, \(\phi_j'\in \mathbb{B}^m\) the embedding of \(v_j\in C_i\) and \(\mathcal{P}_n\) the negative sampling distribution over \(V\): \(\mathcal{P}_n(v)=\frac{deg(v)^{3/4}}{\sum_{v_i\in V}deg(v_i)^{3/4}}\). Intuitively one can see that to minimizing \(L\),
-the distance between \(v_i\) and \(v_j\) should get smaller, while the one between \(v_i\) and \(v_k\) would get larger.
+the distance between \(v_i\) and \(v_j\) should get smaller, while the one between \(v_i\) and \(v_k\) would get larger.
Riemannian optimization.#
diff --git a/notebooks/14_real_world_applications__hand_poses_analysis_in_kendall_shape_space.html b/notebooks/14_real_world_applications__hand_poses_analysis_in_kendall_shape_space.html
index db8e6fb5f..779cb31a1 100644
--- a/notebooks/14_real_world_applications__hand_poses_analysis_in_kendall_shape_space.html
+++ b/notebooks/14_real_world_applications__hand_poses_analysis_in_kendall_shape_space.html
@@ -51,7 +51,7 @@
-
+
@@ -496,7 +496,7 @@ Classifying hands poses with Kendall shape spacesIn this tutorial, we show how to use geomstats to perform a shape data analysis. Specifically, we aim to study the difference between two groups of data: - hand poses that correspond to the action “Grab”, - hand poses heads that correspond to the action “Expand”.
We wish to investigate if there is a difference in these two groups.
The hand poses are represented as the coordinates of 22 joints in 3D:
-
+
In [1]:
diff --git a/notebooks/15_real_world_applications__optic_nerve_heads_analysis_in_kendall_shape_space.html b/notebooks/15_real_world_applications__optic_nerve_heads_analysis_in_kendall_shape_space.html
index 081701a14..4d78a65f9 100644
--- a/notebooks/15_real_world_applications__optic_nerve_heads_analysis_in_kendall_shape_space.html
+++ b/notebooks/15_real_world_applications__optic_nerve_heads_analysis_in_kendall_shape_space.html
@@ -51,7 +51,7 @@
-
+
@@ -495,7 +495,7 @@ Computing with shapes of landmarks in Kendall shape spaces
+
In [1]:
diff --git a/notebooks/16_real_world_applications__visualizations_in_kendall_shape_spaces.html b/notebooks/16_real_world_applications__visualizations_in_kendall_shape_spaces.html
index 0698866c8..825642bcd 100644
--- a/notebooks/16_real_world_applications__visualizations_in_kendall_shape_spaces.html
+++ b/notebooks/16_real_world_applications__visualizations_in_kendall_shape_spaces.html
@@ -51,7 +51,7 @@
-
+
diff --git a/notebooks/17_foundations__stratified_spaces.html b/notebooks/17_foundations__stratified_spaces.html
index 8ad9e66f2..3529968ee 100644
--- a/notebooks/17_foundations__stratified_spaces.html
+++ b/notebooks/17_foundations__stratified_spaces.html
@@ -51,7 +51,7 @@
-
+
@@ -479,7 +479,7 @@ Stratified spaces
Spider#
The \(k\)-Spider consists of \(k\) copies of the positive real line \(\mathbb{R}_{\geq 0}\) glued together at the origin. Within geomstats, we defined the following: 1. Spider Point: a point object defining the ray and the value 2. Spider: the space defined by the number of rays 3. Spider Geometry: by chosing a metric on the rays, we can define a metric on the whole space
-
+
In [1]:
diff --git a/notebooks/18_real_world_applications__sao_paulo_traffic_optimization.html b/notebooks/18_real_world_applications__sao_paulo_traffic_optimization.html
index a0e5cf284..680b2c0bf 100644
--- a/notebooks/18_real_world_applications__sao_paulo_traffic_optimization.html
+++ b/notebooks/18_real_world_applications__sao_paulo_traffic_optimization.html
@@ -51,7 +51,7 @@
-
+
@@ -495,7 +495,7 @@ Optimization of Sao Paulo traffic
+
Figure 1: Sao Paulo: A city with 180km traffic jams – BBC News