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

A few edits to the notebooks #19

Merged
merged 34 commits into from
Jul 12, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
Show all changes
34 commits
Select commit Hold shift + click to select a range
9f94d77
Correctly merge main; add subgrad_Total_Variation functions
hajg-ijk Mar 19, 2024
75a85f0
Fix TV subgradients
hajg-ijk Mar 20, 2024
7c4f35b
Rerun experiments
hajg-ijk Mar 20, 2024
2572058
Merge branch 'main' into rcbm-examples-2
hajg-ijk Apr 17, 2024
8f75b2f
Rework RCBM median experiment qmd
hajg-ijk May 6, 2024
646c0d3
More fixes and rework H2 signal
hajg-ijk May 6, 2024
3365e62
More fixes; rework procrustes
hajg-ijk May 6, 2024
ec10253
Some more fixes on examples
hajg-ijk May 6, 2024
af9f972
Edit math mode
hajg-ijk May 8, 2024
32bac8e
Fix experiments
hajg-ijk May 10, 2024
69d96c9
Add md and files for two experiments
hajg-ijk May 10, 2024
60b2d3f
Add $ to benchmarks; use prettytables
hajg-ijk Jun 21, 2024
de9915f
Add PrettyTables to deps
hajg-ijk Jun 21, 2024
ee0d4dd
Apply similar changes to signal denoising experiment
hajg-ijk Jun 21, 2024
6ffffbe
Apply similar changes to the median experiment
hajg-ijk Jun 21, 2024
95f6a7e
Add prettytables
hajg-ijk Jun 21, 2024
9227152
Add references; correct naming
hajg-ijk Jun 24, 2024
e491628
Don't render RCBM median
hajg-ijk Jun 24, 2024
d0cf37c
Merge branch 'main' into rcbm-examples-2
hajg-ijk Jun 24, 2024
16196d9
Remove qmd rendering of examples; add .md
hajg-ijk Jun 24, 2024
ed9bb62
Add examples to menu
hajg-ijk Jun 24, 2024
ef8e73a
Add svg figures
hajg-ijk Jun 25, 2024
cde4b35
Revert gitignore
hajg-ijk Jun 25, 2024
de08ca5
fix a reference.
kellertuer Jun 25, 2024
53ebed8
Fix literature.
kellertuer Jun 25, 2024
79c8f3e
Fix table rendering (hopefully)
hajg-ijk Jun 25, 2024
4411ab6
Render notebooks with new table formatting
hajg-ijk Jun 26, 2024
6162683
Fix table rendering in examples
hajg-ijk Jun 27, 2024
4b6de87
Fix typo
hajg-ijk Jun 27, 2024
14b29f3
Finalize notebooks (manually edit table spacing)
hajg-ijk Jun 27, 2024
605d1d6
Edit changelog; bump version
hajg-ijk Jun 28, 2024
c25db1e
Run formatter
hajg-ijk Jun 28, 2024
583d4d5
Merge branch 'main' into rcbm-examples
hajg-ijk Jul 11, 2024
9eac654
Fix some old typos
hajg-ijk Jul 11, 2024
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
4 changes: 0 additions & 4 deletions docs/src/examples/H2-Signal-TV.md
Original file line number Diff line number Diff line change
Expand Up @@ -100,10 +100,6 @@ function artificial_H2_signal(
)
end
end
#! In order to have length(data) ∝ pts, we need typeof(l) == Int and mod(pts, l) == 0.
if pts != length(data)
@warn "The length of the output signal will differ from the input number of points."
end
return data, geodesics
end
function matrixify_Poincare_ball(input)
Expand Down
2 changes: 2 additions & 0 deletions docs/src/examples/RCBM-Median.md
Original file line number Diff line number Diff line change
Expand Up @@ -425,6 +425,8 @@ We can take a look at how the algorithms compare to each other in their performa

## The Median on the Sphere

For the last experiment, note that a major difference here is that the sphere has constant positive sectional curvature equal to $1$. In this case, we lose the global convexity of the Riemannian distance and thus of the objective. Minimizers still exist, but they may, in general, be non-unique.

``` julia
subexperiment_name = "Sn"
k_max_sn = 1.0
Expand Down
12 changes: 6 additions & 6 deletions docs/src/examples/Spectral-Procrustes.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,7 @@ using ManifoldDiff, Manifolds, Manopt, ManoptExamples

## The Problem

Given two matrices $A, B \in \mathbb R^{n \times d}$ we aim to solve the orthogonal Procrustes problem
Given two matrices $A, B \in \mathbb R^{n \times d}$ we aim to solve the Procrustes problem

``` math
{\arg\min}_{p \in \mathrm{SO}(d)}\ \Vert A - B \, p \Vert_2
Expand All @@ -31,22 +31,22 @@ Given two matrices $A, B \in \mathbb R^{n \times d}$ we aim to solve the orthogo
where $\mathrm{SO}(d)$ is equipped with the standard bi-invariant metric, and where $\Vert \,\cdot\, \Vert_2$ denotes the spectral norm of a matrix, , its largest singular value.
We aim to find the best matrix $p \in \mathbb R^{d \times d}$ such that $p^\top p = \mathrm{id}$ is the identity matrix, or in other words $p$ is the best rotation.
Note that the spectral norm is convex in the Euclidean sense, but not geodesically convex on $\mathrm{SO}(d)$.
If we define the objective as
Let us define the objective as

``` math
f (p)
=
\Vert A - B \, p \Vert_2
,
.
```

its subdifferential is given by
To obtain subdifferential information, we use

``` math
\partial f(p) = \mathrm{proj}_p(-B^\top UV^\top)
\mathrm{proj}_p(-B^\top UV^\top)
```

where $U$ and $V$ are some left and right singular vectors, respectively, corresponding to the largest singular value of $A - B \, p$, and $\mathrm{proj}_p$ is the projection onto
as a substitute for $\partial f(p)$, where $U$ and $V$ are some left and right singular vectors, respectively, corresponding to the largest singular value of $A - B \, p$, and $\mathrm{proj}_p$ is the projection onto

``` math
\mathcal T_p \mathrm{SO}(d)
Expand Down
4 changes: 0 additions & 4 deletions examples/H2-Signal-TV.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -123,10 +123,6 @@ function artificial_H2_signal(
)
end
end
#! In order to have length(data) ∝ pts, we need typeof(l) == Int and mod(pts, l) == 0.
if pts != length(data)
@warn "The length of the output signal will differ from the input number of points."
end
return data, geodesics
end
function matrixify_Poincare_ball(input)
Expand Down
3 changes: 3 additions & 0 deletions examples/RCBM-Median.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -430,6 +430,9 @@ benchmarking && pretty_table(A2_SPD, tf = tf_markdown, header=col_names_2)
```

## The Median on the Sphere

For the last experiment, note that a major difference here is that the sphere has constant positive sectional curvature equal to $1$. In this case, we lose the global convexity of the Riemannian distance and thus of the objective. Minimizers still exist, but they may, in general, be non-unique.

```{julia}
#| output: false
subexperiment_name = "Sn"
Expand Down
12 changes: 6 additions & 6 deletions examples/Spectral-Procrustes.qmd
Original file line number Diff line number Diff line change
Expand Up @@ -44,7 +44,7 @@ using ManifoldDiff, Manifolds, Manopt, ManoptExamples

## The Problem

Given two matrices $A, B \in \mathbb R^{n \times d}$ we aim to solve the orthogonal Procrustes problem
Given two matrices $A, B \in \mathbb R^{n \times d}$ we aim to solve the Procrustes problem
```math
{\arg\min}_{p \in \mathrm{SO}(d)}\ \Vert A - B \, p \Vert_2
,
Expand All @@ -53,18 +53,18 @@ Given two matrices $A, B \in \mathbb R^{n \times d}$ we aim to solve the orthogo
where $\mathrm{SO}(d)$ is equipped with the standard bi-invariant metric, and where $\Vert \,\cdot\, \Vert_2$ denotes the spectral norm of a matrix, \ie, its largest singular value.
We aim to find the best matrix $p \in \mathbb R^{d \times d}$ such that $p^\top p = \mathrm{id}$ is the identity matrix, or in other words $p$ is the best rotation.
Note that the spectral norm is convex in the Euclidean sense, but not geodesically convex on $\mathrm{SO}(d)$.
If we define the objective as
Let us define the objective as
```math
f (p)
=
\Vert A - B \, p \Vert_2
,
.
```
its subdifferential is given by
To obtain subdifferential information, we use
```math
\partial f(p) = \mathrm{proj}_p(-B^\top UV^\top)
\mathrm{proj}_p(-B^\top UV^\top)
```
where $U$ and $V$ are some left and right singular vectors, respectively, corresponding to the largest singular value of $A - B \, p$, and $\mathrm{proj}_p$ is the projection onto
as a substitute for $\partial f(p)$, where $U$ and $V$ are some left and right singular vectors, respectively, corresponding to the largest singular value of $A - B \, p$, and $\mathrm{proj}_p$ is the projection onto
```math
\mathcal T_p \mathrm{SO}(d)
=
Expand Down
Loading