Skip to content

Commit

Permalink
Fix typos (#299)
Browse files Browse the repository at this point in the history
* docs: fix typos
* Update exact_penalty_method.jl
* Update .zenodo.json
  • Loading branch information
DanielVandH committed Oct 2, 2023
1 parent ba8d5cf commit 48f5ab0
Show file tree
Hide file tree
Showing 77 changed files with 258 additions and 253 deletions.
5 changes: 5 additions & 0 deletions .zenodo.json
Original file line number Diff line number Diff line change
Expand Up @@ -51,6 +51,11 @@
"affiliation": "NTNU Trondheim",
"name": "Kjemsås, Even Stephansen",
"type": "ProjectMember"
},
{
"name": "Daniel VandenHeuvel",
"type": "other",
"orcid": "0000-0001-6462-0135"
}
],
"creators": [
Expand Down
2 changes: 1 addition & 1 deletion docs/make.jl
Original file line number Diff line number Diff line change
Expand Up @@ -113,7 +113,7 @@ makedocs(
"Print Debug Output" => "tutorials/HowToDebug.md",
"Record values" => "tutorials/HowToRecord.md",
"Implement a Solver" => "tutorials/ImplementASolver.md",
"Do Contrained Optimization" => "tutorials/ConstrainedOptimization.md",
"Do Constrained Optimization" => "tutorials/ConstrainedOptimization.md",
"Do Geodesic Regression" => "tutorials/GeodesicRegression.md",
],
"Solvers" => [
Expand Down
4 changes: 2 additions & 2 deletions ext/ManoptLRUCacheExt.jl
Original file line number Diff line number Diff line change
Expand Up @@ -27,7 +27,7 @@ Given a vector of symbols `caches`, this function sets up the
# Keyword arguments
* `p` - (`rand(M)`) a point on a manifold, to both infere its type for keys and initialize caches
* `p` - (`rand(M)`) a point on a manifold, to both infer its type for keys and initialize caches
* `value` - (`0.0`) a value both typing and initialising number-caches, eg. for caching a cost.
* `X` - (`zero_vector(M, p)` a tangent vector at `p` to both type and initialize tangent vector caches
* `cache_size` - (`10`) a default cache size to use
Expand Down Expand Up @@ -70,7 +70,7 @@ function Manopt.init_caches(
push!(lru_caches, LRU{Tuple{P,Int},T}(; maxsize=m))
(c === :GradInequalityConstraint) &&
push!(lru_caches, LRU{Tuple{P,Int},T}(; maxsize=m))
# For the (future) product tangent budle this might also be just Ts
# For the (future) product tangent bundle this might also be just Ts
(c === :GradEqualityConstraints) && push!(lru_caches, LRU{P,Vector{T}}(; maxsize=m))
(c === :GradInequalityConstraints) &&
push!(lru_caches, LRU{P,Vector{T}}(; maxsize=m))
Expand Down
2 changes: 1 addition & 1 deletion ext/ManoptManifoldsExt/manifold_functions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -26,7 +26,7 @@ end
mid_point!(M, y, p, q, x)
Compute the mid point between `p` and `q`. If there is more than one mid point
of (not neccessarily minimizing) geodesics (e.g. on the sphere), the one nearest
of (not necessarily minimizing) geodesics (e.g. on the sphere), the one nearest
to `x` is returned (in place of `y`).
"""
mid_point(M::AbstractManifold, p, q, ::Any) = mid_point(M, p, q)
Expand Down
2 changes: 1 addition & 1 deletion joss/src/example1.jl
Original file line number Diff line number Diff line change
Expand Up @@ -13,7 +13,7 @@ gradF(M, y) = sum(1 / n * grad_distance.(Ref(M), pts, Ref(y)))
x_mean = gradient_descent(M, F, gradF, pts[1])

euclidean_mean = mean(pts)
print("Norm of Euclieadn mean:", norm(euclidean_mean), "\n\n")
print("Norm of Euclidean mean:", norm(euclidean_mean), "\n\n")
euclidean_mean_normed = euclidean_mean / norm(euclidean_mean)

## Second example block
Expand Down
6 changes: 3 additions & 3 deletions src/data/artificialDataFunctions.jl
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ end
artificial_S1_signal(x)
evaluate the example signal $f(x), x ∈ [0,1]$,
of phase-valued data introduces in Sec. 5.1 of [Bergmann et. al., SIAM J Imag Sci, 2014](@cite BergmannLausSteidlWeinmann:2014:1)
for values outside that intervall, this Signal is `missing`.
for values outside that interval, this Signal is `missing`.
"""
function artificial_S1_signal(x::Real)
if x < 0
Expand Down Expand Up @@ -213,7 +213,7 @@ p_2 = \begin{bmatrix}-1&0&0\end{bmatrix}^{\mathrm{T}},
p_3 = \begin{bmatrix}0&0&-1\end{bmatrix}^{\mathrm{T}},
````
where each segment is a cubic Bezér curve, i.e. each point, except $p_3$ has a first point
where each segment is a cubic Bézier curve, i.e. each point, except $p_3$ has a first point
within the following segment $b_i^+$, $i=0,1,2$ and a last point within the previous
segment, except for $p_0$, which are denoted by $b_i^-$, $i=1,2,3$.
This curve is differentiable by the conditions $b_i^- = \gamma_{b_i^+,p_i}(2)$, $i=1,2$,
Expand Down Expand Up @@ -284,7 +284,7 @@ artificial_SPD_image2(pts, fraction)
Generate a point from the signal on the [`Sphere`](https://juliamanifolds.github.io/Manifolds.jl/stable/manifolds/sphere.html) $\mathbb S^2$ by
creating the [Lemniscate of Bernoulli](https://en.wikipedia.org/wiki/Lemniscate_of_Bernoulli)
in the tangent space of `p` sampled at `t` and use èxp` to obtain a point on
in the tangent space of `p` sampled at `t` and use exp` to obtain a point on
the [`Sphere`](https://juliamanifolds.github.io/Manifolds.jl/stable/manifolds/sphere.html).
# Input
Expand Down
8 changes: 4 additions & 4 deletions src/functions/adjoint_differentials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -159,7 +159,7 @@ function adjoint_differential_bezier_control!(
t,
X,
)
# doubly nested broadbast on the Array(Array) of CPs (note broadcast _and_ .)
# doubly nested broadcast on the Array(Array) of CPs (note broadcast _and_ .)
if (0 > t) || (t > length(B))
error(
"The parameter ",
Expand Down Expand Up @@ -225,7 +225,7 @@ end
Y = adjoint_differential_forward_logs(M, p, X)
adjoint_differential_forward_logs!(M, Y, p, X)
Compute the adjoint differential of [`forward_logs`](@ref) ``F`` orrucirng,
Compute the adjoint differential of [`forward_logs`](@ref) ``F`` occurring,
in the power manifold array `p`, the differential of the function
``F_i(p) = \sum_{j ∈ \mathcal I_i} \log_{p_i} p_j``
Expand All @@ -242,7 +242,7 @@ The adjoint differential can be computed in place of `Y`.
* `p` – an array of points on a manifold
* `X` – a tangent vector to from the n-fold power of `p`, where n is the `ndims` of `p`
# Ouput
# Output
`Y` – resulting tangent vector in ``T_p\mathcal M`` representing the adjoint
differentials of the logs.
Expand All @@ -268,7 +268,7 @@ function adjoint_differential_forward_logs!(
I = [i.I...] # array of index
J = I .+ 1 .* (1:d .== k) #i + e_k is j
if all(J .<= maxInd) # is this neighbor in range?
j = CartesianIndex{d}(J...) # neigbbor index as Cartesian Index
j = CartesianIndex{d}(J...) # neighbour index as Cartesian Index
Y[M, I...] =
Y[M, I...] + adjoint_differential_log_basepoint(
M.manifold, p[M, I...], p[M, J...], X[N, I..., k]
Expand Down
8 changes: 4 additions & 4 deletions src/functions/bezier_curves.jl
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
@doc doc"""
BezierSegment
A type to capture a Bezier segment. With ``n`` points, a Beziér segment of degree ``n-1``
A type to capture a Bezier segment. With ``n`` points, a Bézier segment of degree ``n-1``
is stored. On the Euclidean manifold, this yields a polynomial of degree ``n-1``.
This type is mainly used to encapsulate the points within a composite Bezier curve, which
Expand Down Expand Up @@ -29,7 +29,7 @@ Base.show(io::IO, b::BezierSegment) = print(io, "BezierSegment($(b.pts))")
return the [Bézier curve](https://en.wikipedia.org/wiki/Bézier_curve)
``β(⋅;b_0,…,b_n): [0,1] → \mathcal M`` defined by the control points
``b_0,…,b_n∈\mathcal M``, ``n∈\mathbb N``, as a [`BezierSegment`](@ref).
This function implements de Casteljau's algorithm [Casteljau, 1959](@cite deCasteljau:1959), [Casteljau, 1963](@cite deCasteljau:1963) gneralized
This function implements de Casteljau's algorithm [Casteljau, 1959](@cite deCasteljau:1959), [Casteljau, 1963](@cite deCasteljau:1963) generalized
to manifolds by [Popiel, Noakes, J Approx Theo, 2007](@cite PopielNoakes:2007): Let ``γ_{a,b}(t)`` denote the
shortest geodesic connecting ``a,b∈\mathcal M``. Then the curve is defined by the recursion
Expand Down Expand Up @@ -199,7 +199,7 @@ This method reduces the points depending on the optional `reduce` symbol
``b_{0,i}=b_{n_{i-1},i-1}``, so only ``b_{0,i}`` is in the vector.
* `:differentiable` – for a differentiable function additionally
``\log_{b_{0,i}}b_{1,i} = -\log_{b_{n_{i-1},i-1}}b_{n_{i-1}-1,i-1}`` holds.
hence ``b_{n_{i-1}-1,i-1}`` is ommited.
hence ``b_{n_{i-1}-1,i-1}`` is omitted.
If only one segment is given, all points of `b` – i.e. `b.pts` is returned.
"""
Expand Down Expand Up @@ -291,7 +291,7 @@ function get_bezier_segments(
::AbstractManifold, c::Array{P,1}, d, ::Val{:continuous}
) where {P}
length(c) != (sum(d) + 1) && error(
"The number of control points $(length(c)) does not match (for degrees $(d) expcted $(sum(d)+1) points.",
"The number of control points $(length(c)) does not match (for degrees $(d) expected $(sum(d)+1) points.",
)
nums = d .+ [(i == length(d)) ? 1 : 0 for i in 1:length(d)]
endindices = cumsum(nums)
Expand Down
6 changes: 3 additions & 3 deletions src/functions/costs.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ compute the value of the discrete Acceleration of the composite Bezier curve
where for this formula the `pts` along the curve are equispaced and denoted by
``t_i``, ``i=1,…,N``, and ``d_2`` refers to the second order absolute difference [`costTV2`](@ref)
(squared). Note that the Beziér-curve is given in reduces form as a point on a `PowerManifold`,
(squared). Note that the Bézier-curve is given in reduces form as a point on a `PowerManifold`,
together with the `degrees` of the segments and assuming a differentiable curve, the segments
can internally be reconstructed.
Expand Down Expand Up @@ -56,7 +56,7 @@ where for this formula the `pts` along the curve are equispaced and denoted by
(squared), the junction points are denoted by ``p_i``, and to each ``p_i`` corresponds
one data item in the manifold points given in `d`. For details on the acceleration
approximation, see [`cost_acceleration_bezier`](@ref).
Note that the Beziér-curve is given in reduces form as a point on a `PowerManifold`,
Note that the Bézier-curve is given in reduces form as a point on a `PowerManifold`,
together with the `degrees` of the segments and assuming a differentiable curve, the
segments can internally be reconstructed.
Expand Down Expand Up @@ -157,7 +157,7 @@ end
@doc raw"""
costTV(M, x, p)
Compute the ``\operatorname{TV}^p`` functional for a tuple `pT` of pointss
Compute the ``\operatorname{TV}^p`` functional for a tuple `pT` of points
on a manifold `M`, i.e.
```math
Expand Down
2 changes: 1 addition & 1 deletion src/functions/differentials.jl
Original file line number Diff line number Diff line change
Expand Up @@ -200,7 +200,7 @@ and ``\mathcal I_i`` denotes the forward neighbors of ``i``.
* `p` – a point.
* `X` – a tangent vector.
# Ouput
# Output
* `Y` – resulting tangent vector in ``T_x\mathcal N`` representing the differentials of the
logs, where ``\mathcal N`` is the power manifold with the number of dimensions added
to `size(x)`. The computation can also be done in place.
Expand Down
14 changes: 7 additions & 7 deletions src/functions/gradients.jl
Original file line number Diff line number Diff line change
Expand Up @@ -63,7 +63,7 @@ Here the [`get_bezier_junctions`](@ref) are included in the optimization, i.e. s
yields the unconstrained acceleration minimization. Note that this is ill-posed, since
any Bézier curve identical to a geodesic is a minimizer.
Note that the Beziér-curve is given in reduces form as a point on a `PowerManifold`,
Note that the Bézier-curve is given in reduces form as a point on a `PowerManifold`,
together with the `degrees` of the segments and assuming a differentiable curve, the segments
can internally be reconstructed.
Expand Down Expand Up @@ -120,7 +120,7 @@ function _grad_acceleration_bezier(
adjoint_differential_shortest_geodesic_endpoint.(
Ref(M), forward, backward, Ref(0.5), inner
)
# effect of these to the centrol points is the preliminary gradient
# effect of these to the control points is the preliminary gradient
grad_B = [
BezierSegment(a.pts .+ b.pts .+ c.pts) for (a, b, c) in zip(
adjoint_differential_bezier_control(M, Bt, T[[1, 3:n..., n]], asForward),
Expand Down Expand Up @@ -288,7 +288,7 @@ and ``\mathcal I_i`` denotes the forward neighbors of ``i``.
* `M` – a `PowerManifold` manifold
* `x` – a point.
# Ouput
# Output
* X – resulting tangent vector in ``T_x\mathcal M``. The computation can also be done in place.
"""
function grad_TV(M::PowerManifold, x, p::Int=1)
Expand Down Expand Up @@ -362,9 +362,9 @@ where ``\mathcal G`` is the set of indices of the `PowerManifold` manifold `M` a
* `M` – a `PowerManifold` manifold
* `x` – a point.
# Ouput
# Output
* `Y` – resulting tangent vector in ``T_x\mathcal M`` representing the logs, where
``\mathcal N`` is thw power manifold with the number of dimensions added to `size(x)`.
``\mathcal N`` is the power manifold with the number of dimensions added to `size(x)`.
The computation can be done in place of `Y`.
"""
function forward_logs(M::PowerManifold{𝔽,TM,TSize,TPR}, p) where {𝔽,TM,TSize,TPR}
Expand All @@ -389,7 +389,7 @@ function forward_logs(M::PowerManifold{𝔽,TM,TSize,TPR}, p) where {𝔽,TM,TSi
I = i.I
J = I .+ 1 .* e_k_vals[k] #i + e_k is j
if all(J .<= maxInd) # is this neighbor in range?
j = CartesianIndex{d}(J...) # neigbbor index as Cartesian Index
j = CartesianIndex{d}(J...) # neighbour index as Cartesian Index
X[N, i.I..., k] = log(M.manifold, p[M, i.I...], p[M, j.I...])
end
end # directions
Expand All @@ -416,7 +416,7 @@ function forward_logs!(M::PowerManifold{𝔽,TM,TSize,TPR}, X, p) where {𝔽,TM
I = i.I
J = I .+ 1 .* e_k_vals[k] #i + e_k is j
if all(J .<= maxInd) # is this neighbor in range?
j = CartesianIndex{d}(J...) # neigbbor index as Cartesian Index
j = CartesianIndex{d}(J...) # neighbour index as Cartesian Index
X[N, i.I..., k] = log(M.manifold, p[M, i.I...], p[M, j.I...])
end
end # directions
Expand Down
26 changes: 13 additions & 13 deletions src/functions/proximal_maps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -15,7 +15,7 @@ For the mutating variant the computation is done in place of `y`.
# Optional argument
* `p` – (`2`) exponent of the distance.
# Ouput
# Output
* `y` – the result of the proximal map of ``φ``
"""
function prox_distance(M::AbstractManifold, λ, f, x, p::Int=2)
Expand Down Expand Up @@ -68,7 +68,7 @@ parameter `λ`.
(default is given in brackets)
* `p` – (1) exponent of the distance of the TV term
# Ouput
# Output
* `(y1,y2)` – resulting tuple of points of the ``\operatorname{prox}_{λφ}(```(x1,x2)```)``.
The result can also be computed in place.
Expand Down Expand Up @@ -113,7 +113,7 @@ end
compute the proximal maps ``\operatorname{prox}_{λ\varphi}`` of
all forward differences occurring in the power manifold array, i.e.
``\varphi(xi,xj) = d_{\mathcal M}^p(xi,xj)`` with `xi` and `xj` are array
elemets of `x` and `j = i+e_k`, where `e_k` is the ``k``th unit vector.
elements of `x` and `j = i+e_k`, where `e_k` is the ``k``th unit vector.
The parameter `λ` is the prox parameter.
# Input
Expand All @@ -125,7 +125,7 @@ The parameter `λ` is the prox parameter.
(default is given in brackets)
* `p` – (1) exponent of the distance of the TV term
# Ouput
# Output
* `y` – resulting point containing with all mentioned proximal
points evaluated (in a cyclic order). The computation can also be done in place
"""
Expand All @@ -142,7 +142,7 @@ function prox_TV(M::PowerManifold, λ, x, p::Int=1)
if (i[k] % 2) == l
J = i.I .+ ek.I #i + e_k is j
if all(J .<= maxInd) # is this neighbor in range?
j = CartesianIndex(J...) # neigbbor index as Cartesian Index
j = CartesianIndex(J...) # neighbour index as Cartesian Index
(y[i], y[j]) = prox_TV(M.manifold, λ, (y[i], y[j]), p) # Compute TV on these
end
end
Expand All @@ -164,7 +164,7 @@ function prox_TV!(M::PowerManifold, y, λ, x, p::Int=1)
if (i[k] % 2) == l # even/odd splitting
J = i.I .+ ek.I #i + e_k is j
if all(J .<= maxInd) # is this neighbor in range?
j = CartesianIndex(J...) # neigbbor index as Cartesian Index
j = CartesianIndex(J...) # neighbour index as Cartesian Index
prox_TV!(M.manifold, [y[i], y[j]], λ, (y[i], y[j]), p) # Compute TV on these
end
end
Expand Down Expand Up @@ -192,7 +192,7 @@ The parameter `λ` is the prox parameter.
(default is given in brackets)
* `p` – (`1`) exponent of the distance of the TV term
# Ouput
# Output
* `y` – resulting Array of points with all mentioned proximal
points evaluated (in a parallel within the arrays elements).
The computation can also be done in place.
Expand Down Expand Up @@ -221,8 +221,8 @@ function prox_parallel_TV(M::PowerManifold, λ, x::AbstractVector, p::Int=1)
if (i[k] % 2) == l
J = i.I .+ ek.I #i + e_k is j
if all(J .<= maxInd) # is this neighbor in range?
j = CartesianIndex(J...) # neigbbor index as Cartesian Index
# parallel means we apply each (direction even/odd) to a seperate copy of the data.
j = CartesianIndex(J...) # neighbour index as Cartesian Index
# parallel means we apply each (direction even/odd) to a separate copy of the data.
(yV[k, l + 1][i], yV[k, l + 1][j]) = prox_TV(
M.manifold, λ, (xV[k, l + 1][i], xV[k, l + 1][j]), p
) # Compute TV on these
Expand Down Expand Up @@ -259,8 +259,8 @@ function prox_parallel_TV!(
if (i[k] % 2) == l
J = i.I .+ ek.I #i + e_k is j
if all(J .<= maxInd) # is this neighbor in range?
j = CartesianIndex(J...) # neigbbor index as Cartesian Index
# parallel means we apply each (direction even/odd) to a seperate copy of the data.
j = CartesianIndex(J...) # neighbour index as Cartesian Index
# parallel means we apply each (direction even/odd) to a separate copy of the data.
prox_TV!(
M.manifold,
[yV[k, l + 1][i], yV[k, l + 1][j]],
Expand Down Expand Up @@ -359,7 +359,7 @@ end
prox_TV2!(M, y, λ, x[, p=1])
compute the proximal maps ``\operatorname{prox}_{λ\varphi}`` of
all centered second order differences occuring in the power manifold array, i.e.
all centered second order differences occurring in the power manifold array, i.e.
``\varphi(x_k,x_i,x_j) = d_2(x_k,x_i.x_j)``, where ``k,j`` are backward and forward
neighbors (along any dimension in the array of `x`).
The parameter `λ` is the prox parameter.
Expand All @@ -374,7 +374,7 @@ The parameter `λ` is the prox parameter.
* `p` – (`1`) exponent of the distance of the TV term
# Output
* `y` – resulting point with all mentioned proximal points evaluated (in a cylic order).
* `y` – resulting point with all mentioned proximal points evaluated (in a cyclic order).
The computation can also be done in place.
"""
function prox_TV2(M::PowerManifold{N,T}, λ, x, p::Int=1) where {N,T}
Expand Down
Loading

0 comments on commit 48f5ab0

Please sign in to comment.