From 48f5ab0a1de4593a774a3c33e72b7eb17c22bd05 Mon Sep 17 00:00:00 2001 From: Daniel VandenHeuvel <95613936+DanielVandH@users.noreply.github.com> Date: Mon, 2 Oct 2023 16:16:07 +1000 Subject: [PATCH] Fix typos (#299) * docs: fix typos * Update exact_penalty_method.jl * Update .zenodo.json --- .zenodo.json | 5 ++++ docs/make.jl | 2 +- ext/ManoptLRUCacheExt.jl | 4 +-- ext/ManoptManifoldsExt/manifold_functions.jl | 2 +- joss/src/example1.jl | 2 +- src/data/artificialDataFunctions.jl | 6 ++-- src/functions/adjoint_differentials.jl | 8 +++--- src/functions/bezier_curves.jl | 8 +++--- src/functions/costs.jl | 6 ++-- src/functions/differentials.jl | 2 +- src/functions/gradients.jl | 14 +++++----- src/functions/proximal_maps.jl | 26 ++++++++--------- src/helpers/checks.jl | 14 +++++----- src/helpers/exports/Asymptote.jl | 10 +++---- src/plans/constrained_plan.jl | 20 ++++++------- src/plans/cost_plan.jl | 2 +- src/plans/count.jl | 4 +-- src/plans/debug.jl | 28 +++++++++---------- src/plans/difference_of_convex_plan.jl | 6 ++-- src/plans/embedded_objective.jl | 2 +- src/plans/frank_wolfe_plan.jl | 6 ++-- src/plans/gradient_plan.jl | 18 ++++++------ src/plans/higher_order_primal_dual_plan.jl | 2 +- src/plans/nonlinear_least_squares_plan.jl | 2 +- src/plans/objective.jl | 8 +++--- src/plans/primal_dual_plan.jl | 4 +-- src/plans/proximal_plan.jl | 4 +-- src/plans/quasi_newton_plan.jl | 20 ++++++------- src/plans/record.jl | 14 +++++----- src/plans/solver_state.jl | 12 ++++---- src/plans/stepsize.jl | 16 +++++------ src/plans/stopping_criterion.jl | 6 ++-- src/solvers/ChambollePock.jl | 2 +- src/solvers/FrankWolfe.jl | 10 +++---- src/solvers/LevenbergMarquardt.jl | 6 ++-- src/solvers/NelderMead.jl | 12 ++++---- .../adaptive_regularization_with_cubics.jl | 24 ++++++++-------- src/solvers/alternating_gradient_descent.jl | 2 +- src/solvers/augmented_Lagrangian_method.jl | 6 ++-- src/solvers/conjugate_gradient_descent.jl | 4 +-- src/solvers/cyclic_proximal_point.jl | 2 +- .../difference-of-convex-proximal-point.jl | 16 +++++------ src/solvers/difference_of_convex_algorithm.jl | 16 +++++------ src/solvers/exact_penalty_method.jl | 6 ++-- src/solvers/gradient_descent.jl | 4 +-- src/solvers/particle_swarm.jl | 10 +++---- src/solvers/primal_dual_semismooth_Newton.jl | 2 +- src/solvers/quasi_Newton.jl | 10 +++---- src/solvers/solver.jl | 8 +++--- .../truncated_conjugate_gradient_descent.jl | 6 ++-- src/solvers/trust_regions.jl | 6 ++-- test/functions/test_bezier.jl | 2 +- test/plans/test_cache.jl | 4 +-- test/plans/test_constrained_plan.jl | 4 +-- test/plans/test_counts.jl | 2 +- test/plans/test_debug.jl | 4 +-- test/plans/test_difference_of_convex_plan.jl | 2 +- test/plans/test_gradient_plan.jl | 4 +-- test/plans/test_hessian_plan.jl | 4 +-- test/plans/test_primal_dual_plan.jl | 2 +- test/plans/test_proximal_plan.jl | 2 +- test/plans/test_stochastic_gradient_plan.jl | 8 +++--- test/plans/test_stopping_criteria.jl | 2 +- test/plans/test_subgradient_plan.jl | 2 +- test/solvers/test_Levenberg_Marquardt.jl | 2 +- test/solvers/test_Nelder_Mead.jl | 2 +- ...est_adaptive_regularization_with_cubics.jl | 6 ++-- test/solvers/test_alternating_gradient.jl | 2 +- test/solvers/test_cyclic_proximal_point.jl | 2 +- test/solvers/test_difference_of_convex.jl | 4 +-- test/solvers/test_gradient_descent.jl | 2 +- test/solvers/test_particle_swarm.jl | 2 +- .../test_primal_dual_semismooth_Newton.jl | 2 +- test/solvers/test_quasi_Newton.jl | 4 +-- .../test_stochastic_gradient_descent.jl | 2 +- test/solvers/test_subgradient_method.jl | 2 +- test/solvers/test_trust_regions.jl | 2 +- 77 files changed, 258 insertions(+), 253 deletions(-) diff --git a/.zenodo.json b/.zenodo.json index c5969adb9d..004a426411 100644 --- a/.zenodo.json +++ b/.zenodo.json @@ -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": [ diff --git a/docs/make.jl b/docs/make.jl index 60675a5ca5..f36f320db0 100755 --- a/docs/make.jl +++ b/docs/make.jl @@ -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" => [ diff --git a/ext/ManoptLRUCacheExt.jl b/ext/ManoptLRUCacheExt.jl index 79659bd2b5..9df20a705e 100644 --- a/ext/ManoptLRUCacheExt.jl +++ b/ext/ManoptLRUCacheExt.jl @@ -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 @@ -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)) diff --git a/ext/ManoptManifoldsExt/manifold_functions.jl b/ext/ManoptManifoldsExt/manifold_functions.jl index ee5af8954c..1c49520c05 100644 --- a/ext/ManoptManifoldsExt/manifold_functions.jl +++ b/ext/ManoptManifoldsExt/manifold_functions.jl @@ -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) diff --git a/joss/src/example1.jl b/joss/src/example1.jl index b73a983ca5..6eea86cfe9 100644 --- a/joss/src/example1.jl +++ b/joss/src/example1.jl @@ -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 diff --git a/src/data/artificialDataFunctions.jl b/src/data/artificialDataFunctions.jl index 2eb130d18a..f1adb6171e 100644 --- a/src/data/artificialDataFunctions.jl +++ b/src/data/artificialDataFunctions.jl @@ -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 @@ -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$, @@ -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 diff --git a/src/functions/adjoint_differentials.jl b/src/functions/adjoint_differentials.jl index cf9428de06..cf89312912 100644 --- a/src/functions/adjoint_differentials.jl +++ b/src/functions/adjoint_differentials.jl @@ -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 ", @@ -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`` @@ -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. @@ -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] diff --git a/src/functions/bezier_curves.jl b/src/functions/bezier_curves.jl index 8eaa95c2c0..e859aae37c 100644 --- a/src/functions/bezier_curves.jl +++ b/src/functions/bezier_curves.jl @@ -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 @@ -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 @@ -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. """ @@ -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) diff --git a/src/functions/costs.jl b/src/functions/costs.jl index ad6c611113..b54a23dbae 100644 --- a/src/functions/costs.jl +++ b/src/functions/costs.jl @@ -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. @@ -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. @@ -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 diff --git a/src/functions/differentials.jl b/src/functions/differentials.jl index 28455fdb2e..96a5a6a9e6 100644 --- a/src/functions/differentials.jl +++ b/src/functions/differentials.jl @@ -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. diff --git a/src/functions/gradients.jl b/src/functions/gradients.jl index 9e0cc8565f..d1dec11b92 100644 --- a/src/functions/gradients.jl +++ b/src/functions/gradients.jl @@ -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. @@ -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), @@ -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) @@ -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} @@ -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 @@ -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 diff --git a/src/functions/proximal_maps.jl b/src/functions/proximal_maps.jl index 69199b15b4..378dad66a2 100644 --- a/src/functions/proximal_maps.jl +++ b/src/functions/proximal_maps.jl @@ -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) @@ -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. @@ -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 @@ -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 """ @@ -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 @@ -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 @@ -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. @@ -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 @@ -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]], @@ -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. @@ -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} diff --git a/src/helpers/checks.jl b/src/helpers/checks.jl index 48acdc14e7..ad81665007 100644 --- a/src/helpers/checks.jl +++ b/src/helpers/checks.jl @@ -26,7 +26,7 @@ no plot will be generated, * `exactness_tol` - (`1e3*eps(eltype(errors))`) is all errors are below this tolerance, the check is considered to be exact * `io` – (`nothing`) provide an `IO` to print the check result to -* `name` (`"differntial"`) – name to display in the check (e.g. if checking gradient) +* `name` (`"differential"`) – name to display in the check (e.g. if checking gradient) * `plot`- (`false`) whether to plot the resulting check (if `Plots.jl` is loaded). The plot is in log-log-scale. This is returned and can then also be saved. * `slope_tol` – (`0.1`) tolerance for the slope (global) of the approximation * `throw_error` - (`false`) throw an error message if the gradient or Hessian is wrong @@ -46,7 +46,7 @@ function prepare_check_result( if max(errors...) < exactness_tol (io !== nothing) && print( io, - "All errors are below the exactness tolerance $(exactness_tol). Your check can be considered exact, hence there is no use to cheeck for a slope.\n", + "All errors are below the exactness tolerance $(exactness_tol). Your check can be considered exact, hence there is no use to check for a slope.\n", ) return true end @@ -86,7 +86,7 @@ end @doc raw""" check_differential(M, F, dF, p=rand(M), X=rand(M; vector_at=p); kwargs...) -Check numerivcally whether the differential `dF(M,p,X)` of `F(M,p)` is correct. +Check numerically whether the differential `dF(M,p,X)` of `F(M,p)` is correct. This implements the method described in [Section 4.8, Boumal, Cambridge Press, 2023](@cite Boumal:2023). @@ -153,7 +153,7 @@ end @doc raw""" check_gradient(M, F, gradF, p=rand(M), X=rand(M; vector_at=p); kwargs...) -Check numerivcally whether the gradient `gradF(M,p)` of `F(M,p)` is correct, that is whether +Check numerically whether the gradient `gradF(M,p)` of `F(M,p)` is correct, that is whether ```math @@ -213,7 +213,7 @@ end @doc raw""" check_Hessian(M, f, grad_f, Hess_f, p=rand(M), X=rand(M; vector_at=p), Y=rand(M, vector_at=p); kwargs...) -Check numerivcally whether the Hessian `{operatorname{Hess} f(M,p, X)` of `f(M,p)` is correct. +Check numerically whether the Hessian `{operatorname{Hess} f(M,p, X)` of `f(M,p)` is correct. For this we require either a second-order retraction or a critical point ``p`` of `f`. @@ -237,7 +237,7 @@ no plot will be generated. * `check_symmetry` – (`true`) check whether the Hessian is symmetric, see [`is_Hessian_symmetric`](@ref) * `check_vector` – (`false`) check whether ``\operatorname{Hess} f(p)[X] \in T_p\mathcal M`` using `is_vector`. * `mode` - (`:Default`) specify the mode, by default we assume to have a second order retraction given by `retraction_method=` - you can also this method if you already _have_ a cirtical point `p`. + you can also this method if you already _have_ a critical point `p`. Set to `:CritalPoint` to use [`gradient_descent`](@ref) to find a critical point. Note: This requires (and evaluates) new tangent vectors `X` and `Y` @@ -495,7 +495,7 @@ function find_best_slope_window(X, Y, window=nothing; slope=2.0, slope_tol=0.1) end # not best interval - maybe best slope if we have not yet found an r? if r_best == 0 && abs(b - slope) < abs(b_best - slope) - # but do not upate `r` since this indicates we only get the best r + # but do not update `r` since this indicates we only get the best r a_best = a b_best = b i_best = j diff --git a/src/helpers/exports/Asymptote.jl b/src/helpers/exports/Asymptote.jl index 05884ea0cf..220bec7ad7 100644 --- a/src/helpers/exports/Asymptote.jl +++ b/src/helpers/exports/Asymptote.jl @@ -13,7 +13,7 @@ to Asymptote. * `curves` – an `Array` of `Arrays` of points on the sphere, where each inner array is interpreted as a curve and is accompanied by an entry within `colors` * `points` – an `Array` of `Arrays` of points on the sphere where each inner array is - itnerpreted as a set of points and is accompanied by an entry within `colors` + interpreted as a set of points and is accompanied by an entry within `colors` * `tangent_vectors` – an `Array` of `Arrays` of tuples, where the first is a points, the second a tangent vector and each set of vectors is accompanied by an entry from within `colors` @@ -206,7 +206,7 @@ or three-dimensional data with points on the [Sphere](https://juliamanifolds.git # Optional Arguments (Asymptote) * `arrow_head_size` - (`1.8`) size of the arrowheads of the vectors (in mm) -* `camera_position` - position of the camrea (default: centered above xy-plane) +* `camera_position` - position of the camera (default: centered above xy-plane) szene * `target` - position the camera points at (default: center of xy-plane within data). @@ -246,7 +246,7 @@ function asymptote_export_S2_data( # map elevation to colormap c = get(elevation_color_scheme, el + π / 2, (0.0, Float64(π))) # write arrow in this colormap - # transpose image to comply with image adresses (first index column downwards, second rows) + # transpose image to comply with image addresses (first index column downwards, second rows) write( io, string( @@ -277,10 +277,10 @@ definite matrices. * `color_scheme` - A `ColorScheme` for Geometric Anisotropy Index * `scale_axes` - (`(1/3,1/3,1/3)`) move symmetric positive definite matrices closer to each other by a factor per direction compared to the distance - esimated by the maximal eigenvalue of all involved SPD points + estimated by the maximal eigenvalue of all involved SPD points # Optional Arguments (Asymptote) -* `camera_position` - position of the camrea (default: centered above xy-plane) +* `camera_position` - position of the camera (default: centered above xy-plane) szene. * `target` - position the camera points at (default: center of xy-plane within data). diff --git a/src/plans/constrained_plan.jl b/src/plans/constrained_plan.jl index 5da627ee2a..dffc798e14 100644 --- a/src/plans/constrained_plan.jl +++ b/src/plans/constrained_plan.jl @@ -43,10 +43,10 @@ It consists of There are two ways to specify the constraints ``g`` and ``h``. -1. as one `Function` returning a vector in ``\mathbb R^m`` and ``\mathbb R^n`` respecively. +1. as one `Function` returning a vector in ``\mathbb R^m`` and ``\mathbb R^n`` respectively. This might be easier to implement but requires evaluating _all_ constraints even if only one is needed. 2. as a `AbstractVector{<:Function}` where each function returns a real number. - This requires each constrant to be implemented as a single function, but it is possible to evaluate also only a single constraint. + This requires each constraint to be implemented as a single function, but it is possible to evaluate also only a single constraint. The gradients ``\operatorname{grad}g``, ``\operatorname{grad}h`` have to follow the same form. Additionally they can be implemented as in-place functions or as allocating ones. @@ -59,7 +59,7 @@ This difference is indicated by the `evaluation` keyword. evaluation=AllocatingEvaluation() ) -Where `f, g, h` describe the cost, inequality and equality constraints, respecitvely, as +Where `f, g, h` describe the cost, inequality and equality constraints, respectively, as described above and `grad_f, grad_g, grad_h` are the corresponding gradient functions in one of the 4 formats. If the objective does not have inequality constraints, you can set `G` and `gradG` no `nothing`. If the problem does not have equality constraints, you can set `H` and `gradH` no `nothing` or leave them out. @@ -396,7 +396,7 @@ evaluate the gradient of the `j` th equality constraint ``(\operatorname{grad} h !!! note For the [`FunctionConstraint`](@ref) variant of the problem, this function still evaluates the full gradient. For the [`InplaceEvaluation`](@ref) and [`FunctionConstraint`](@ref) of the problem, this function currently also calls [`get_equality_constraints`](@ref), - since this is the only way to determine the number of cconstraints. It also allocates a full tangent vector. + since this is the only way to determine the number of constraints. It also allocates a full tangent vector. """ get_grad_equality_constraint(M::AbstractManifold, co::ConstrainedManifoldObjective, p, j) function get_grad_equality_constraint( @@ -452,7 +452,7 @@ Evaluate the gradient of the `j`th equality constraint ``(\operatorname{grad} h( !!! note For the [`FunctionConstraint`](@ref) variant of the problem, this function still evaluates the full gradient. For the [`InplaceEvaluation`](@ref) of the [`FunctionConstraint`](@ref) of the problem, this function currently also calls [`get_inequality_constraints`](@ref), - since this is the only way to determine the number of cconstraints and allocates a full vector of tangent vectors + since this is the only way to determine the number of constraints and allocates a full vector of tangent vectors """ get_grad_equality_constraint!( M::AbstractManifold, X, co::ConstrainedManifoldObjective, p, j @@ -511,13 +511,13 @@ end @doc raw""" get_grad_equality_constraints(M::AbstractManifold, co::ConstrainedManifoldObjective, p) -eevaluate all gradients of the equality constraints ``\operatorname{grad} h(x)`` or ``\bigl(\operatorname{grad} h_1(x), \operatorname{grad} h_2(x),\ldots, \operatorname{grad}h_n(x)\bigr)`` +evaluate all gradients of the equality constraints ``\operatorname{grad} h(x)`` or ``\bigl(\operatorname{grad} h_1(x), \operatorname{grad} h_2(x),\ldots, \operatorname{grad}h_n(x)\bigr)`` of the [`ConstrainedManifoldObjective`](@ref) `P` at `p`. !!! note For the [`InplaceEvaluation`](@ref) and [`FunctionConstraint`](@ref) variant of the problem, this function currently also calls [`get_equality_constraints`](@ref), - since this is the only way to determine the number of cconstraints. + since this is the only way to determine the number of constraints. """ get_grad_equality_constraints(M::AbstractManifold, co::ConstrainedManifoldObjective, p) function get_grad_equality_constraints( @@ -624,7 +624,7 @@ Evaluate the gradient of the `i` th inequality constraints ``(\operatorname{grad !!! note For the [`FunctionConstraint`](@ref) variant of the problem, this function still evaluates the full gradient. For the [`InplaceEvaluation`](@ref) and [`FunctionConstraint`](@ref) of the problem, this function currently also calls [`get_inequality_constraints`](@ref), - since this is the only way to determine the number of cconstraints. + since this is the only way to determine the number of constraints. """ get_grad_inequality_constraint(M::AbstractManifold, co::ConstrainedManifoldObjective, p, i) function get_grad_inequality_constraint( @@ -681,7 +681,7 @@ of the [`ConstrainedManifoldObjective`](@ref) `P` in place of ``X`` !!! note For the [`FunctionConstraint`](@ref) variant of the problem, this function still evaluates the full gradient. For the [`InplaceEvaluation`](@ref) and [`FunctionConstraint`](@ref) of the problem, this function currently also calls [`get_inequality_constraints`](@ref), - since this is the only way to determine the number of cconstraints. + since this is the only way to determine the number of constraints. evaluate all gradients of the inequality constraints ``\operatorname{grad} h(x)`` or ``\bigl(g_1(x), g_2(x),\ldots,g_m(x)\bigr)`` of the [`ConstrainedManifoldObjective`](@ref) ``p`` at ``x`` in place of `X``, which is a vector of ``m`` tangent vectors . """ @@ -745,7 +745,7 @@ of the [`ConstrainedManifoldObjective`](@ref) ``P`` at ``p``. !!! note for the [`InplaceEvaluation`](@ref) and [`FunctionConstraint`](@ref) variant of the problem, this function currently also calls [`get_equality_constraints`](@ref), - since this is the only way to determine the number of cconstraints. + since this is the only way to determine the number of constraints. """ get_grad_inequality_constraints(M::AbstractManifold, co::ConstrainedManifoldObjective, x) function get_grad_inequality_constraints( diff --git a/src/plans/cost_plan.jl b/src/plans/cost_plan.jl index 46e1118011..88febd2c45 100644 --- a/src/plans/cost_plan.jl +++ b/src/plans/cost_plan.jl @@ -9,7 +9,7 @@ abstract type AbstractManifoldCostObjective{T<:AbstractEvaluationType,TC} <: @doc raw""" ManifoldCostObjective{T, TC} <: AbstractManifoldCostObjective{T, TC} -speficy an [`AbstractManifoldObjective`](@ref) that does only have information about +specify an [`AbstractManifoldObjective`](@ref) that does only have information about the cost function ``f\colon \mathbb M → ℝ`` implemented as a function `(M, p) -> c` to compute the cost value `c` at `p` on the manifold `M`. diff --git a/src/plans/count.jl b/src/plans/count.jl index d83765db84..d1368a16ea 100644 --- a/src/plans/count.jl +++ b/src/plans/count.jl @@ -75,7 +75,7 @@ function ManifoldCountObjective( init::I=0; p::P=rand(M), ) where {P,I<:Integer,O<:AbstractManifoldObjective} - # Infere the sizes of the counters from the symbols if possible + # Infer the sizes of the counters from the symbols if possible counts = Pair{Symbol,Union{I,Vector{I}}}[] for symbol in count l = _get_counter_size(M, objective, symbol, p) @@ -116,7 +116,7 @@ end """ get_count(co::ManifoldCountObjective, s::Symbol, mode::Symbol=:None) -Get the number of counts for a certain symbel `s`. +Get the number of counts for a certain symbol `s`. Depending on the `mode` different results appear if the symbol does not exist in the dictionary diff --git a/src/plans/debug.jl b/src/plans/debug.jl index ad8a20a551..cd1a2a0a89 100644 --- a/src/plans/debug.jl +++ b/src/plans/debug.jl @@ -83,7 +83,7 @@ function status_summary(dst::DebugSolverState) $(dst.state) ## Debug$s""" - else # for length 1 the group is equivvalent to the summary of the single state + else # for length 1 the group is equivalent to the summary of the single state return status_summary(dst.state) end end @@ -203,7 +203,7 @@ during the last iteration. See [`DebugEntryChange`](@ref) for the general case # Keyword Parameters * `storage` – (`StoreStateAction( [:Gradient] )`) – (eventually shared) the storage of the previous action * `prefix` – (`"Last Change:"`) prefix of the debug output (ignored if you set `format`) -* `io` – (`stdout`) default steream to print the debug to. +* `io` – (`stdout`) default stream to print the debug to. * `format` - ( `"$prefix %f"`) format to print the output using an sprintf format. * `inverse_retraction_method` - (`default_inverse_retraction_method(M)`) the inverse retraction to be used for approximating distance. @@ -279,7 +279,7 @@ print the current cost function value, see [`get_cost`](@ref). # Parameters * `format` - (`"$prefix %f"`) format to print the output using sprintf and a prefix (see `long`). -* `io` – (`stdout`) default steream to print the debug to. +* `io` – (`stdout`) default stream to print the debug to. * `long` - (`false`) short form to set the format to `f(x):` (default) or `current cost: ` and the cost """ mutable struct DebugCost <: DebugAction @@ -476,7 +476,7 @@ during the last iteration. See [`DebugEntryChange`](@ref) for the general case # Keyword Parameters * `storage` – (`StoreStateAction( (:Gradient,) )`) – (eventually shared) the storage of the previous action * `prefix` – (`"Last Change:"`) prefix of the debug output (ignored if you set `format`) -* `io` – (`stdout`) default steream to print the debug to. +* `io` – (`stdout`) default stream to print the debug to. * `format` - ( `"$prefix %f"`) format to print the output using an sprintf format. """ mutable struct DebugGradientChange{VTR<:AbstractVectorTransportMethod} <: DebugAction @@ -541,7 +541,7 @@ debug for the current iterate (stored in `get_iterate(o)`). # Parameters -* `io` – (`stdout`) default steream to print the debug to. +* `io` – (`stdout`) default stream to print the debug to. * `long::Bool` whether to print `x:` or `current iterate` """ mutable struct DebugIterate <: DebugAction @@ -575,7 +575,7 @@ status_summary(di::DebugIterate) = "(:Iterate, \"$(escape_string(di.format))\")" # Keyword parameters * `format` - (`"# %-6d"`) format to print the output using an sprintf format. -* `io` – (`stdout`) default steream to print the debug to. +* `io` – (`stdout`) default stream to print the debug to. debug for the current iteration (prefixed with `#` by ) """ @@ -598,7 +598,7 @@ status_summary(di::DebugIteration) = "(:Iteration, \"$(escape_string(di.format)) DebugMessages <: DebugAction An [`AbstractManoptSolverState`](@ref) or one of its substeps like a -[`Stepsize`](@ref) might generate warnings throughout their compuations. +[`Stepsize`](@ref) might generate warnings throughout their computations. This debug can be used to `:print` them display them as `:info` or `:warnings` or even `:error`, depending on the message type. @@ -606,7 +606,7 @@ depending on the message type. DebugMessages(mode=:Info; io::IO=stdout) Initialize the messages debug to a certain `mode`. Available modes are -* `:Error` – issue the messages as an error and hence stop at any issue occuring +* `:Error` – issue the messages as an error and hence stop at any issue occurring * `:Info` – issue the messages as an `@info` * `:Print` – print messages to the steam `io`. * `:Warning` – issue the messages as a warning @@ -715,7 +715,7 @@ The measured time is rounded using the given `time_accuracy` and printed after [ # Keyword Parameters * `prefix` – (`"Last Change:"`) prefix of the debug output (ignored if you set `format`) -* `io` – (`stdout`) default steream to print the debug to. +* `io` – (`stdout`) default strea to print the debug to. * `format` - ( `"$prefix %s"`) format to print the output using an sprintf format, where `%s` is the canonicalized time`. * `mode` – (`:cumulative`) whether to display the total time or reset on every call using `:iterative`. * `start` – (`false`) indicate whether to start the timer on creation or not. Otherwise it might only be started on firsr call. @@ -825,7 +825,7 @@ function (d::DebugWarnIfCostIncreases)( `ConstantStepsize(value)` with a `value` less than $(get_last_stepsize(p,st,i)).""" end if d.status === :Once - @warn "Further warnings will be supressed, use DebugWarnIfCostIncreases(:Always) to get all warnings." + @warn "Further warnings will be suppressed, use DebugWarnIfCostIncreases(:Always) to get all warnings." d.status = :No end else @@ -866,7 +866,7 @@ function (d::DebugWarnIfCostNotFinite)( @warn """The cost is not finite. At iteration #$i the cost evaluated to $(cost).""" if d.status === :Once - @warn "Further warnings will be supressed, use DebugWarnIfCostNotFinite(:Always) to get all warnings." + @warn "Further warnings will be suppressed, use DebugWarnIfCostNotFinite(:Always) to get all warnings." d.status = :No end end @@ -920,7 +920,7 @@ function (d::DebugWarnIfFieldNotFinite)( @warn """$s is or contains values that are not finite. At iteration #$i it evaluated to $(v).""" if d.status === :Once - @warn "Further warnings will be supressed, use DebugWaranIfFieldNotFinite(:$(d.field), :Always) to get all warnings." + @warn "Further warnings will be suppressed, use DebugWaranIfFieldNotFinite(:$(d.field), :Always) to get all warnings." d.status = :No end end @@ -949,7 +949,7 @@ given an array of `Symbol`s, `String`s [`DebugAction`](@ref)s and `Ints` This function returns a dictionary with an entry `:All` containing one general [`DebugAction`](@ref), possibly a [`DebugGroup`](@ref) of entries. It might contain an entry `:Start`, `:Step`, `:Stop` with an action (each) to specify what to do -at the start, after a step or at the end of an Algorithm, respectively. On all three occastions the `:All` action is exectued. +at the start, after a step or at the end of an Algorithm, respectively. On all three occasions the `:All` action is executed. Note that only the `:Stop` entry is actually filled when specifying the `:Stop` symbol. # Example @@ -993,7 +993,7 @@ end create a [`DebugAction`](@ref) where -* a `String`yields the correspoinding divider +* a `String`yields the corresponding divider * a [`DebugAction`](@ref) is passed through * a [`Symbol`] creates [`DebugEntry`](@ref) of that symbol, with the exceptions of `:Change`, `:Iterate`, `:Iteration`, and `:Cost`. diff --git a/src/plans/difference_of_convex_plan.jl b/src/plans/difference_of_convex_plan.jl index 029127d846..e13a1c3cca 100644 --- a/src/plans/difference_of_convex_plan.jl +++ b/src/plans/difference_of_convex_plan.jl @@ -1,7 +1,7 @@ @doc raw""" ManifoldDifferenceOfConvexObjective{E} <: AbstractManifoldCostObjective{E} -Specify an objetive for a [`difference_of_convex_algorithm`](@ref). +Specify an objective for a [`difference_of_convex_algorithm`](@ref). The objective ``f: \mathcal M \to ℝ`` is given as @@ -227,12 +227,12 @@ where both ``g`` and ``h`` are convex, lsc. and proper. * `gradient` - the gradient of the cost * `grad_h!!` – a function ``\operatorname{grad}h: \mathcal M → T\mathcal M``, -Note that both the gradients miht be given in two possible signatures +Note that both the gradients might be given in two possible signatures as allocating or Inplace. # Constructor - ManifoldDifferenceOfConvexProximalObjective(gradh; cost=norhting, gradient=nothing) + ManifoldDifferenceOfConvexProximalObjective(gradh; cost=nothing, gradient=nothing) an note that neither cost nor gradient are required for the algorithm, just for eventual debug or stopping criteria. diff --git a/src/plans/embedded_objective.jl b/src/plans/embedded_objective.jl index 3f7d1334c3..3bc6a73de6 100644 --- a/src/plans/embedded_objective.jl +++ b/src/plans/embedded_objective.jl @@ -130,7 +130,7 @@ end get_hessian!(M::AbstractManifold, Y, emo::EmbeddedManifoldObjective, p, X) Evaluate the Hessian of an objective defined in the embedding, that is embed `p` and `X` -before calling the Hessiand function stored in the [`EmbeddedManifoldObjective`](@ref). +before calling the Hessian function stored in the [`EmbeddedManifoldObjective`](@ref). The returned Hessian is then converted to a Riemannian Hessian calling [`riemannian_Hessian`](https://juliamanifolds.github.io/ManifoldDiff.jl/stable/library/#ManifoldDiff.riemannian_Hessian-Tuple{AbstractManifold,%20Any,%20Any,%20Any,%20Any}). diff --git a/src/plans/frank_wolfe_plan.jl b/src/plans/frank_wolfe_plan.jl index 8a5a6104f2..ff1c470a77 100644 --- a/src/plans/frank_wolfe_plan.jl +++ b/src/plans/frank_wolfe_plan.jl @@ -9,7 +9,7 @@ The cost function reads F(q) = ⟨X, \log_p q⟩ ``` -The values `p`and `X` are stored within this functor and hsould be references to the +The values `p` and `X` are stored within this functor and should be references to the iterate and gradient from within [`FrankWolfeState`](@ref). """ mutable struct FrankWolfeCost{P,T} @@ -23,7 +23,7 @@ end @doc raw""" FrankWolfeGradient{P,T} -A structure to represent the gradeint of the oracle sub problem in the [`Frank_Wolfe_method`](@ref), +A structure to represent the gradient of the oracle sub problem in the [`Frank_Wolfe_method`](@ref), that is for a given point `p` and a tangent vector `X` we have ```math @@ -32,7 +32,7 @@ F(q) = ⟨X, \log_p q⟩ Its gradient can be computed easily using `adjoint_differential_log_argument`. -The values `p`and `X` are stored within this functor and hsould be references to the +The values `p` and `X` are stored within this functor and should be references to the iterate and gradient from within [`FrankWolfeState`](@ref). """ mutable struct FrankWolfeGradient{P,T} diff --git a/src/plans/gradient_plan.jl b/src/plans/gradient_plan.jl index ac35abe126..3b2efa594b 100644 --- a/src/plans/gradient_plan.jl +++ b/src/plans/gradient_plan.jl @@ -31,7 +31,7 @@ end @doc raw""" ManifoldGradientObjective{T<:AbstractEvaluationType} <: AbstractManifoldGradientObjective{T} -specify an objetive containing a cost and its gradient +specify an objective containing a cost and its gradient # Fields @@ -64,7 +64,7 @@ end @doc raw""" ManifoldCostGradientObjective{T} <: AbstractManifoldObjective{T} -specify an objetive containing one function to perform a combined computation of cost and its gradient +specify an objective containing one function to perform a combined computation of cost and its gradient # Fields @@ -156,7 +156,7 @@ The `T=`[`AllocatingEvaluation`](@ref) problem might still allocate memory withi When the non-mutating variant is called with a `T=`[`InplaceEvaluation`](@ref) memory for the result is allocated. -Note that the order of parameters follows the philisophy of `Manifolds.jl`, namely that +Note that the order of parameters follows the philosophy of `Manifolds.jl`, namely that even for the mutating variant, the manifold is the first parameter and the (inplace) tangent vector `X` comes second. """ @@ -214,7 +214,7 @@ end get_gradient(agst::AbstractGradientSolverState) return the gradient stored within gradient options. -THe default resturns `agst.X`. +THe default returns `agst.X`. """ get_gradient(agst::AbstractGradientSolverState) = agst.X @@ -233,7 +233,7 @@ end get_iterate(agst::AbstractGradientSolverState) return the iterate stored within gradient options. -THe default resturns `agst.p`. +THe default returns `agst.p`. """ get_iterate(agst::AbstractGradientSolverState) = agst.p @@ -293,8 +293,8 @@ Add momentum to a gradient problem, where by default just a gradient evaluation vector_transport_method=default_vector_transport_method(M, typeof(p)), ) -Initialize a momentum gradient rule to `s`. Note that the keyword agruments `p` and `X` -will be overriden often, so their initialisation is meant to set the to certain types of +Initialize a momentum gradient rule to `s`. Note that the keyword arguments `p` and `X` +will be overridden often, so their initialisation is meant to set the to certain types of points or tangent vectors, if you do not use the default types with respect to `M`. """ mutable struct MomentumGradient{P,T,R<:Real,VTM<:AbstractVectorTransportMethod} <: @@ -421,7 +421,7 @@ Given This compute a Nesterov type update using the following steps, see [Zhang, Sra, Preprint, 2018](@cite ZhangSra:2018) -1. Copute the positive root, i.e. ``α_k∈(0,1)`` of ``α^2 = h_k\bigl((1-α_k)γ_k+α_k μ\bigr)``. +1. Compute the positive root, i.e. ``α_k∈(0,1)`` of ``α^2 = h_k\bigl((1-α_k)γ_k+α_k μ\bigr)``. 2. Set ``\bar γ_k+1 = (1-α_k)γ_k + α_kμ`` 3. ``y_k = \operatorname{retr}_{x_k}\Bigl(\frac{α_kγ_k}{γ_k + α_kμ}\operatorname{retr}^{-1}_{x_k}v_k \Bigr)`` 4. ``x_{k+1} = \operatorname{retr}_{y_k}(-h_k \operatorname{grad}f(y_k))`` @@ -431,7 +431,7 @@ This compute a Nesterov type update using the following steps, see [Zhang, Sra, Then the direction from ``x_k`` to ``x_k+1``, i.e. ``d = \operatorname{retr}^{-1}_{x_k}x_{k+1}`` is returned. # Constructor - Nesterov(M::AbstractManifold, p::P; γ=0.001, μ=0.9, schrinkage = k -> 0.8; + Nesterov(M::AbstractManifold, p::P; γ=0.001, μ=0.9, shrinkage = k -> 0.8; inverse_retraction_method=LogarithmicInverseRetraction()) Initialize the Nesterov acceleration, where `x0` initializes `v`. diff --git a/src/plans/higher_order_primal_dual_plan.jl b/src/plans/higher_order_primal_dual_plan.jl index f945b58628..3e2c21f1d4 100644 --- a/src/plans/higher_order_primal_dual_plan.jl +++ b/src/plans/higher_order_primal_dual_plan.jl @@ -77,7 +77,7 @@ end * `stop` - a [`StoppingCriterion`](@ref) * `update_primal_base` (`( amp, ams, i) -> o.m`) function to update the primal base * `update_dual_base` (`(amp, ams, i) -> o.n`) function to update the dual base -* `retraction_method` – (`default_retraction_method(M, typeof(p))`) the rectraction to use +* `retraction_method` – (`default_retraction_method(M, typeof(p))`) the retraction to use * `inverse_retraction_method` - (`default_inverse_retraction_method(M, typeof(p))`) an inverse retraction to use. * `vector_transport_method` - (`default_vector_transport_method(M, typeof(p))`) a vector transport to use diff --git a/src/plans/nonlinear_least_squares_plan.jl b/src/plans/nonlinear_least_squares_plan.jl index 14e18762b5..69ae0dfee4 100644 --- a/src/plans/nonlinear_least_squares_plan.jl +++ b/src/plans/nonlinear_least_squares_plan.jl @@ -135,7 +135,7 @@ A default value is given in brackets if a parameter can be left out in initializ * `damping_term_min` – initial (and also minimal) value of the damping term * `β` – parameter by which the damping term is multiplied when the current new point is rejected * `expect_zero_residual` – (`false`) if true, the algorithm expects that the value of - residual (objective) at mimimum is equal to 0. + residual (objective) at minimum is equal to 0. # Constructor diff --git a/src/plans/objective.jl b/src/plans/objective.jl index 6a90a798fa..6dc9f5ca8a 100644 --- a/src/plans/objective.jl +++ b/src/plans/objective.jl @@ -9,7 +9,7 @@ abstract type AbstractEvaluationType end AbstractManifoldObjective{E<:AbstractEvaluationType} Describe the collection of the optimization function ``f\colon \mathcal M → \bbR` (or even a vectorial range) -and its corresponding elements, which might for example be a gradient or (one or more) prxomial maps. +and its corresponding elements, which might for example be a gradient or (one or more) proximal maps. All these elements should usually be implemented as functions `(M, p) -> ...`, or `(M, X, p) -> ...` that is @@ -51,7 +51,7 @@ struct InplaceEvaluation <: AbstractEvaluationType end ReturnManifoldObjective{E,O2,O1<:AbstractManifoldObjective{E}} <: AbstractDecoratedManifoldObjective{E,O2} -A wrapper to indicate that `get_solver_result` should return the inner objetcive. +A wrapper to indicate that `get_solver_result` should return the inner objective. The types are such that one can still dispatch on the undecorated type `O2` of the original objective as well. @@ -101,12 +101,12 @@ end get_objective(o::AbstractManifoldObjective, recursive=true) return the (one step) undecorated [`AbstractManifoldObjective`](@ref) of the (possibly) decorated `o`. -As long as your decorated objective stores the objetive within `o.objective` and +As long as your decorated objective stores the objective within `o.objective` and the [`dispatch_objective_decorator`](@ref) is set to `Val{true}`, the internal state are extracted automatically. By default the objective that is stored within a decorated objective is assumed to be at -`o.objective`. Overwrtie `_get_objective(o, ::Val{true}, recursive) to change this bevahiour for your objective `o` +`o.objective`. Overwrite `_get_objective(o, ::Val{true}, recursive) to change this behaviour for your objective `o` for both the recursive and the nonrecursive case. If `recursive` is set to `false`, only the most outer decorator is taken away instead of all. diff --git a/src/plans/primal_dual_plan.jl b/src/plans/primal_dual_plan.jl index 803afb7600..c14571a3de 100644 --- a/src/plans/primal_dual_plan.jl +++ b/src/plans/primal_dual_plan.jl @@ -35,7 +35,7 @@ Describes an Objective linearized or exact Chambolle-Pock algorithm, cf. [Bergma # Fields All fields with !! can either be mutating or nonmutating functions, which should be set -depenting on the parameter `T <: AbstractEvaluationType`. +depending on the parameter `T <: AbstractEvaluationType`. * `cost` ``F + G(Λ(⋅))`` to evaluate interims cost function values * `linearized_forward_operator!!` linearized operator for the forward operation in the algorithm ``DΛ`` @@ -568,7 +568,7 @@ Compute the dual residual at current iterate ``k`` given the necessary values `` X_{k-1}``, and ``n_{k-1}`` from the previous iterate. The formula is slightly different depending on the `o.variant` used: -For the `:lineaized` it reads +For the `:linearized` it reads ```math \Bigl\lVert \frac{1}{τ}\bigl( diff --git a/src/plans/proximal_plan.jl b/src/plans/proximal_plan.jl index 2bdfd1e3f5..597084956e 100644 --- a/src/plans/proximal_plan.jl +++ b/src/plans/proximal_plan.jl @@ -16,7 +16,7 @@ specify a problem for solvers based on the evaluation of proximal map(s). * `number_of_proxes` - (`ones(length(proxes))`` number of proximal Maps per function, e.g. if one of the maps is a combined one such that the proximal Maps functions return more than one entry per function, you have to adapt this value. - if not speciifed, it is set to one prox per function. + if not specified, it is set to one prox per function. # See also [`cyclic_proximal_point`](@ref), [`get_cost`](@ref), [`get_proximal_map`](@ref) @@ -211,7 +211,7 @@ end @doc raw""" RecordProximalParameter <: RecordAction -recoed the current iterates proximal point algorithm parameter given by in +record the current iterates proximal point algorithm parameter given by in [`AbstractManoptSolverState`](@ref)s `o.λ`. """ mutable struct RecordProximalParameter <: RecordAction diff --git a/src/plans/quasi_newton_plan.jl b/src/plans/quasi_newton_plan.jl index a927818c81..2676dc88ee 100644 --- a/src/plans/quasi_newton_plan.jl +++ b/src/plans/quasi_newton_plan.jl @@ -14,7 +14,7 @@ get_message(::AbstractQuasiNewtonDirectionUpdate) = "" AbstractQuasiNewtonUpdateRule Specify a type for the different [`AbstractQuasiNewtonDirectionUpdate`](@ref)s, -that is, e.g. for a [`QuasiNewtonMatrixDirectionUpdate`](@ref) there are several differeent updates to the matrix, +that is, e.g. for a [`QuasiNewtonMatrixDirectionUpdate`](@ref) there are several different updates to the matrix, while the default for [`QuasiNewtonLimitedMemoryDirectionUpdate`](@ref) the most prominent is [`InverseBFGS`](@ref). """ abstract type AbstractQuasiNewtonUpdateRule end @@ -22,7 +22,7 @@ abstract type AbstractQuasiNewtonUpdateRule end @doc raw""" BFGS <: AbstractQuasiNewtonUpdateRule -indicates in [`AbstractQuasiNewtonDirectionUpdate`](@ref) that the Riemanian BFGS update is used in the Riemannian quasi-Newton method. +indicates in [`AbstractQuasiNewtonDirectionUpdate`](@ref) that the Riemannian BFGS update is used in the Riemannian quasi-Newton method. We denote by ``\widetilde{H}_k^\mathrm{BFGS}`` the operator concatenated with a vector transport and its inverse before and after to act on ``x_{k+1} = R_{x_k}(α_k η_k)``. Then the update formula reads @@ -45,7 +45,7 @@ struct BFGS <: AbstractQuasiNewtonUpdateRule end @doc raw""" InverseBFGS <: AbstractQuasiNewtonUpdateRule -indicates in [`AbstractQuasiNewtonDirectionUpdate`](@ref) that the inverse Riemanian BFGS update is used in the Riemannian quasi-Newton method. +indicates in [`AbstractQuasiNewtonDirectionUpdate`](@ref) that the inverse Riemannian BFGS update is used in the Riemannian quasi-Newton method. We denote by ``\widetilde{B}_k^\mathrm{BFGS}`` the operator concatenated with a vector transport and its inverse before and after to act on ``x_{k+1} = R_{x_k}(α_k η_k)``. Then the update formula reads @@ -74,7 +74,7 @@ struct InverseBFGS <: AbstractQuasiNewtonUpdateRule end @doc raw""" DFP <: AbstractQuasiNewtonUpdateRule -indicates in an [`AbstractQuasiNewtonDirectionUpdate`](@ref) that the Riemanian DFP update is used in the Riemannian quasi-Newton method. +indicates in an [`AbstractQuasiNewtonDirectionUpdate`](@ref) that the Riemannian DFP update is used in the Riemannian quasi-Newton method. We denote by ``\widetilde{H}_k^\mathrm{DFP}`` the operator concatenated with a vector transport and its inverse before and after to act on ``x_{k+1} = R_{x_k}(α_k η_k)``. Then the update formula reads @@ -103,7 +103,7 @@ struct DFP <: AbstractQuasiNewtonUpdateRule end @doc raw""" InverseDFP <: AbstractQuasiNewtonUpdateRule -indicates in [`AbstractQuasiNewtonDirectionUpdate`](@ref) that the inverse Riemanian DFP update is used in the Riemannian quasi-Newton method. +indicates in [`AbstractQuasiNewtonDirectionUpdate`](@ref) that the inverse Riemannian DFP update is used in the Riemannian quasi-Newton method. We denote by ``\widetilde{B}_k^\mathrm{DFP}`` the operator concatenated with a vector transport and its inverse before and after to act on ``x_{k+1} = R_{x_k}(α_k η_k)``. Then the update formula reads @@ -127,7 +127,7 @@ struct InverseDFP <: AbstractQuasiNewtonUpdateRule end @doc raw""" SR1 <: AbstractQuasiNewtonUpdateRule -indicates in [`AbstractQuasiNewtonDirectionUpdate`](@ref) that the Riemanian SR1 update is used in the Riemannian quasi-Newton method. +indicates in [`AbstractQuasiNewtonDirectionUpdate`](@ref) that the Riemannian SR1 update is used in the Riemannian quasi-Newton method. We denote by ``\widetilde{H}_k^\mathrm{SR1}`` the operator concatenated with a vector transport and its inverse before and after to act on ``x_{k+1} = R_{x_k}(α_k η_k)``. Then the update formula reads @@ -167,7 +167,7 @@ end @doc raw""" InverseSR1 <: AbstractQuasiNewtonUpdateRule -indicates in [`AbstractQuasiNewtonDirectionUpdate`](@ref) that the inverse Riemanian SR1 update is used in the Riemannian quasi-Newton method. +indicates in [`AbstractQuasiNewtonDirectionUpdate`](@ref) that the inverse Riemannian SR1 update is used in the Riemannian quasi-Newton method. We denote by ``\widetilde{B}_k^\mathrm{SR1}`` the operator concatenated with a vector transport and its inverse before and after to act on ``x_{k+1} = R_{x_k}(α_k η_k)``. Then the update formula reads @@ -208,7 +208,7 @@ end @doc raw""" Broyden <: AbstractQuasiNewtonUpdateRule -indicates in [`AbstractQuasiNewtonDirectionUpdate`](@ref) that the Riemanian Broyden update is used in the Riemannian quasi-Newton method, which is as a convex combination of [`BFGS`](@ref) and [`DFP`](@ref). +indicates in [`AbstractQuasiNewtonDirectionUpdate`](@ref) that the Riemannian Broyden update is used in the Riemannian quasi-Newton method, which is as a convex combination of [`BFGS`](@ref) and [`DFP`](@ref). We denote by ``\widetilde{H}_k^\mathrm{Br}`` the operator concatenated with a vector transport and its inverse before and after to act on ``x_{k+1} = R_{x_k}(α_k η_k)``. Then the update formula reads @@ -246,7 +246,7 @@ Broyden(φ::Float64) = Broyden(φ, :constant) @doc raw""" InverseBroyden <: AbstractQuasiNewtonUpdateRule -Indicates in [`AbstractQuasiNewtonDirectionUpdate`](@ref) that the Riemanian Broyden update +Indicates in [`AbstractQuasiNewtonDirectionUpdate`](@ref) that the Riemannian Broyden update is used in the Riemannian quasi-Newton method, which is as a convex combination of [`InverseBFGS`](@ref) and [`InverseDFP`](@ref). @@ -381,7 +381,7 @@ end @doc raw""" QuasiNewtonLimitedMemoryDirectionUpdate <: AbstractQuasiNewtonDirectionUpdate -This [`AbstractQuasiNewtonDirectionUpdate`](@ref) represents the limited-memory Riemanian BFGS update, where the approximating operator is represented by ``m`` stored pairs of tangent vectors ``\{ \widetilde{s}_i, \widetilde{y}_i\}_{i=k-m}^{k-1}`` in the ``k``-th iteration. +This [`AbstractQuasiNewtonDirectionUpdate`](@ref) represents the limited-memory Riemannian BFGS update, where the approximating operator is represented by ``m`` stored pairs of tangent vectors ``\{ \widetilde{s}_i, \widetilde{y}_i\}_{i=k-m}^{k-1}`` in the ``k``-th iteration. For the calculation of the search direction ``η_k``, the generalisation of the two-loop recursion is used (see [Huang, Gallican, Absil, SIAM J. Optim., 2015](@cite HuangGallivanAbsil:2015)), since it only requires inner products and linear combinations of tangent vectors in ``T_{x_k} \mathcal{M}``. For that the stored pairs of tangent vectors ``\{ \widetilde{s}_i, \widetilde{y}_i\}_{i=k-m}^{k-1}``, the gradient ``\operatorname{grad}f(x_k)`` of the objective function ``f`` in ``x_k`` and the positive definite self-adjoint operator ```math diff --git a/src/plans/record.jl b/src/plans/record.jl index 213b644dbd..3d56ada11a 100644 --- a/src/plans/record.jl +++ b/src/plans/record.jl @@ -155,12 +155,12 @@ get_record(r::RecordAction) = r.recorded_values get_index(rs::RecordSolverState, s::Symbol) ro[s] -Get the recorded values for reording type `s`, see [`get_record`](@ref) for details. +Get the recorded values for recorded type `s`, see [`get_record`](@ref) for details. get_index(rs::RecordSolverState, s::Symbol, i...) ro[s, i...] -Acces the recording type of type `s` and call its [`RecordAction`](@ref) with `[i...]`. +Access the recording type of type `s` and call its [`RecordAction`](@ref) with `[i...]`. """ getindex(rs::RecordSolverState, s::Symbol) = get_record(rs, s) getindex(rs::RecordSolverState, s::Symbol, i...) = get_record_action(rs, s)[i...] @@ -185,7 +185,7 @@ end group a set of [`RecordAction`](@ref)s into one action, where the internal [`RecordAction`](@ref)s act independently, but the results can be collected in a grouped fashion, i.e. tuples per calls of this group. -The enries can be later addressed either by index or semantic Symbols +The entries can be later addressed either by index or semantic Symbols # Constructors RecordGroup(g::Array{<:RecordAction, 1}) @@ -201,7 +201,7 @@ A RecordGroup to record the current iteration and the cost. The cost can then be r = RecordGroup([RecordIteration(), RecordCost()], Dict(:Cost => 2)) -A RecordGroup to record the current iteration and the cost, wich can then be accesed using `get_record(:Cost)` or `r[:Cost]`. +A RecordGroup to record the current iteration and the cost, which can then be accessed using `get_record(:Cost)` or `r[:Cost]`. r = RecordGroup([RecordIteration(), :Cost => RecordCost()]) @@ -581,7 +581,7 @@ mutable struct RecordTime <: RecordAction end end function (r::RecordTime)(p::AbstractManoptProblem, s::AbstractManoptSolverState, i::Int) - # At iteartion zero also reset start + # At iteration zero also reset start (i == 0) && (r.start = Nanosecond(time_ns())) t = Nanosecond(time_ns()) - r.start (r.mode == :iterative) && (r.start = Nanosecond(time_ns())) @@ -640,9 +640,9 @@ create a [`RecordAction`](@ref) where * a [`RecordAction`](@ref) is passed through * a [`Symbol`] creates [`RecordEntry`](@ref) of that symbol, with the exceptions of - * `:Change` - to recorde the change of the iterates in `o.x`` + * `:Change` - to record the change of the iterates in `o.x`` * `:Iterate` - to record the iterate - * `:Iteration` - to record the current iteration numner + * `:Iteration` - to record the current iteration number * `:Cost` - to record the current cost function value * `:Time` - to record the total time taken after every iteration * `:IterativeTime` – to record the times taken for each iteration. diff --git a/src/plans/solver_state.jl b/src/plans/solver_state.jl index c326502405..f24211ba2f 100644 --- a/src/plans/solver_state.jl +++ b/src/plans/solver_state.jl @@ -143,7 +143,7 @@ the [`dispatch_objective_decorator`](@ref) is set to `Val{true}`, the internal state are extracted automatically. By default the state that is stored within a decorated state is assumed to be at -`s.state`. Overwrtie `_get_state(s, ::Val{true}, recursive) to change this bevahiour for your state `s` +`s.state`. Overwrite `_get_state(s, ::Val{true}, recursive) to change this behaviour for your state `s` for both the recursive and the nonrecursive case. If `recursive` is set to `false`, only the most outer decorator is taken away instead of all. @@ -309,7 +309,7 @@ _storage_copy_vector(::AbstractManifold, X::Number) = StorageRef(X) internal storage for [`AbstractStateAction`](@ref)s to store a tuple of fields from an [`AbstractManoptSolverState`](@ref)s -This functor posesses the usual interface of functions called during an +This functor possesses the usual interface of functions called during an iteration, i.e. acts on `(p,o,i)`, where `p` is a [`AbstractManoptProblem`](@ref), `o` is an [`AbstractManoptSolverState`](@ref) and `i` is the current iteration. @@ -338,12 +338,12 @@ To handle the general storage, use `get_storage` and `has_storage` with keys as For the point storage use `PointStorageKey`. For tangent vector storage use `VectorStorageKey`. Point and tangent storage have been optimized to be more efficient. -# Constructiors +# Constructors StoreStateAction(s::Vector{Symbol}) This is equivalent as providing `s` to the keyword `store_fields`, just that here, no manifold -is necessay for the construciton. +is necessity for the construction. StoreStateAction(M) @@ -493,7 +493,7 @@ end get_storage(a::AbstractStateAction, ::VectorStorageKey{key}) where {key} Return the internal value of the [`AbstractStateAction`](@ref) `a` at the -`Symbol` `key` that represents a vector vector. +`Symbol` `key` that represents a vector. """ @inline function get_storage(a::AbstractStateAction, ::VectorStorageKey{key}) where {key} if haskey(a.vector_values, key) @@ -618,7 +618,7 @@ This function returns 0 if there was nothing to count Available symbols from within the solver state * `:Iterations` is passed on to the `stop` field to obtain the - iterataion at which the solver stopped. + iteration at which the solver stopped. """ function get_count(ams::AbstractManoptSolverState, s::Symbol) return get_count(ams, Val(s)) diff --git a/src/plans/stepsize.jl b/src/plans/stepsize.jl index 9971c5538b..7c0fa36c29 100644 --- a/src/plans/stepsize.jl +++ b/src/plans/stepsize.jl @@ -175,7 +175,7 @@ end """ Linesearch <: Stepsize -An abstract functor to represent line search type step size deteminations, see +An abstract functor to represent line search type step size determinations, see [`Stepsize`](@ref) for details. One example is the [`ArmijoLinesearch`](@ref) functor. @@ -206,7 +206,7 @@ last step size. # Fields * `initial_stepsize` – (`1.0`) and initial step size -* `retraction_method` – (`default_retraction_method(M)`) the rectraction to use +* `retraction_method` – (`default_retraction_method(M)`) the retraction to use * `contraction_factor` – (`0.95`) exponent for line search reduction * `sufficient_decrease` – (`0.1`) gain within Armijo's rule * `last_stepsize` – (`initialstepsize`) the last step size we start the search with @@ -219,7 +219,7 @@ Furthermore the following fields act as safeguards * `stop_when_stepsize_less - (`0.0`) smallest stepsize when to stop (the last one before is taken) * `stop_when_stepsize_exceeds - ([`max_stepsize`](@ref)`(M, p)`) – largest stepsize when to stop. * `stop_increasing_at_step` - (^100`) last step to increase the stepsize (phase 1), -* `stop_decreasing_at_step` - (`1000`) last step size to decrese the stepsize (phase 2), +* `stop_decreasing_at_step` - (`1000`) last step size to decrease the stepsize (phase 2), Pass `:Messages` to a `debug=` to see `@info`s when these happen. @@ -369,7 +369,7 @@ function linesearch_backtrack( fNew = f(M, p_new) search_dir_inner = real(inner(M, p, η, grad_f_at_p)) if search_dir_inner >= 0 - msg = "The search direction η might not be a descent directon, since ⟨η, grad_f(p)⟩ ≥ 0." + msg = "The search direction η might not be a descent direction, since ⟨η, grad_f(p)⟩ ≥ 0." end i = 0 while fNew < f0 + decrease * s * search_dir_inner # increase @@ -471,7 +471,7 @@ and ``γ`` is the sufficient decrease parameter ``∈(0,1)``. We can then find t * `memory_size` – (`10`) number of iterations after which the cost value needs to be lower than the current one * `bb_min_stepsize` – (`1e-3`) lower bound for the Barzilai-Borwein step size greater than zero * `bb_max_stepsize` – (`1e3`) upper bound for the Barzilai-Borwein step size greater than min_stepsize -* `retraction_method` – (`ExponentialRetraction()`) the rectraction to use +* `retraction_method` – (`ExponentialRetraction()`) the retraction to use * `strategy` – (`direct`) defines if the new step size is computed using the direct, indirect or alternating strategy * `storage` – (for `:Iterate` and `:Gradient`) a [`StoreStateAction`](@ref) * `stepsize_reduction` – (`0.5`) step size reduction factor contained in the interval (0,1) @@ -483,7 +483,7 @@ Furthermore the following fields act as safeguards * `stop_when_stepsize_less - (`0.0`) smallest stepsize when to stop (the last one before is taken) * `stop_when_stepsize_exceeds - ([`max_stepsize`](@ref)`(M, p)`) – largest stepsize when to stop. * `stop_increasing_at_step` - (^100`) last step to increase the stepsize (phase 1), -* `stop_decreasing_at_step` - (`1000`) last step size to decrese the stepsize (phase 2), +* `stop_decreasing_at_step` - (`1000`) last step size to decrease the stepsize (phase 2), Pass `:Messages` to a `debug=` to see `@info`s when these happen. @@ -496,7 +496,7 @@ with the Fields above in their order as optional arguments (deprecated). NonmonotoneLinesearch(M) with the Fields above in their order as keyword arguments and where the retraction -and vector transport are set to the default ones on `M`, repsectively. +and vector transport are set to the default ones on `M`, respectively. The constructors return the functor to perform nonmonotone line search. """ @@ -624,7 +624,7 @@ end function (a::NonmonotoneLinesearch)( M::mT, x, F::TF, gradFx::T, η::T, old_x, old_gradient, iter::Int; kwargs... ) where {mT<:AbstractManifold,TF,T} - #find the difference between the current and previous gardient after the previous gradient is transported to the current tangent space + #find the difference between the current and previous gradient after the previous gradient is transported to the current tangent space grad_diff = gradFx - vector_transport_to(M, old_x, old_gradient, x, a.vector_transport_method) #transport the previous step into the tangent space of the current manifold point diff --git a/src/plans/stopping_criterion.jl b/src/plans/stopping_criterion.jl index 81dc502848..b2046d28df 100644 --- a/src/plans/stopping_criterion.jl +++ b/src/plans/stopping_criterion.jl @@ -191,7 +191,7 @@ For the storage a [`StoreStateAction`](@ref) is used initialize the stopping criterion to a threshold `ε` using the [`StoreStateAction`](@ref) `a`, which is initialized to just store `:Iterate` by -default. You can also provide an inverse_retraction_method for the `distance` or a manifol +default. You can also provide an inverse_retraction_method for the `distance` or a manifold to use its default inverse retraction. """ mutable struct StopWhenChangeLess{ @@ -309,7 +309,7 @@ end """ update_stopping_criterion!(c::StopWhenCostLess, :MinCost, v) -Update the minimal cost below which the slgorithm shall stop +Update the minimal cost below which the algorithm shall stop """ function update_stopping_criterion!(c::StopWhenCostLess, ::Val{:MinCost}, v) c.threshold = v @@ -515,7 +515,7 @@ end """ update_stopping_criterion!(c::StopWhenStepsizeLess, :MinStepsize, v) -Update the minimal step size below which the slgorithm shall stop +Update the minimal step size below which the algorithm shall stop """ function update_stopping_criterion!(c::StopWhenStepsizeLess, ::Val{:MinStepsize}, v) c.threshold = v diff --git a/src/solvers/ChambollePock.jl b/src/solvers/ChambollePock.jl index 1cb858d457..e9aed1d406 100644 --- a/src/solvers/ChambollePock.jl +++ b/src/solvers/ChambollePock.jl @@ -214,7 +214,7 @@ For more details on the algorithm, see [Bergmann et al., Found. Comput. Math., 2 * `stopping_criterion` – (`stopAtIteration(100)`) a [`StoppingCriterion`](@ref) * `update_primal_base` – (`missing`) function to update `m` (identity by default/missing) * `update_dual_base` – (`missing`) function to update `n` (identity by default/missing) -* `retraction_method` – (`default_retraction_method(M, typeof(p))`) the rectraction to use +* `retraction_method` – (`default_retraction_method(M, typeof(p))`) the retraction to use * `inverse_retraction_method` - (`default_inverse_retraction_method(M, typeof(p))`) an inverse retraction to use. * `vector_transport_method` - (`default_vector_transport_method(M, typeof(p))`) a vector transport to use diff --git a/src/solvers/FrankWolfe.jl b/src/solvers/FrankWolfe.jl index e7a211b726..45cb721797 100644 --- a/src/solvers/FrankWolfe.jl +++ b/src/solvers/FrankWolfe.jl @@ -152,12 +152,12 @@ use a retraction and its inverse. - as a function `(M, p) -> X` or a function `(M, X, p) -> X` working in place of `X`. * `p` – an initial value ``p ∈ \mathcal C``, note that it really has to be a feasible point -Alternatively to `f` and `grad_f` you can prodive +Alternatively to `f` and `grad_f` you can provide the [`AbstractManifoldGradientObjective`](@ref) `gradient_objective` directly. ## Keyword Arguments -* `evaluation` - ([`AllocatingEvaluation`](@ref)) whether `grad_f` is an inplace or allocating (default) funtion +* `evaluation` - ([`AllocatingEvaluation`](@ref)) whether `grad_f` is an inplace or allocating (default) function * `initial_vector` – (`zero_vectoir(M,p)`) how to initialize the inner gradient tangent vector * `stopping_criterion` – ([`StopAfterIteration`](@ref)`(500) | `[`StopWhenGradientNormLess`](@ref)`(1.0e-6)`) a stopping criterion * `retraction_method` – (`default_retraction_method(M, typeof(p))`) a type of retraction @@ -229,7 +229,7 @@ end Frank_Wolfe_method!(M, f, grad_f, p; kwargs...) Frank_Wolfe_method!(M, gradient_objective, p; kwargs...) -Peform the Frank Wolfe method in place of `p`. +Perform the Frank Wolfe method in place of `p`. For all options and keyword arguments, see [`Frank_Wolfe_method`](@ref). """ @@ -332,7 +332,7 @@ function step_solver!( return fws end # -# Variant II: subtask is a mutating function providing a closed form soltuion +# Variant II: subtask is a mutating function providing a closed form solution # function step_solver!( amp::AbstractManoptProblem, fws::FrankWolfeState{P,T,F,InplaceEvaluation}, i @@ -353,7 +353,7 @@ function step_solver!( return fws end # -# Variant II: subtask is an allocating function providing a closed form soltuion +# Variant II: subtask is an allocating function providing a closed form solution # function step_solver!( amp::AbstractManoptProblem, fws::FrankWolfeState{P,T,F,AllocatingEvaluation}, i diff --git a/src/solvers/LevenbergMarquardt.jl b/src/solvers/LevenbergMarquardt.jl index b75a0ac8b2..5a4405fa1b 100644 --- a/src/solvers/LevenbergMarquardt.jl +++ b/src/solvers/LevenbergMarquardt.jl @@ -34,7 +34,7 @@ then the keyword `jacobian_tangent_basis` below is ignored * `stopping_criterion` – ([`StopWhenAny`](@ref)`(`[`StopAfterIteration`](@ref)`(200), `[`StopWhenGradientNormLess`](@ref)`(1e-12))`) a functor inheriting from [`StoppingCriterion`](@ref) indicating when to stop. * `expect_zero_residual` – (`false`) whether or not the algorithm might expect that the value of - residual (objective) at mimimum is equal to 0. + residual (objective) at minimum is equal to 0. * `η` – Scaling factor for the sufficient cost decrease threshold required to accept new proposal points. Allowed range: `0 < η < 1`. * `damping_term_min` – initial (and also minimal) value of the damping term * `β` – parameter by which the damping term is multiplied when the current new point is rejected @@ -171,7 +171,7 @@ function LevenbergMarquardt!( ), kwargs..., #collect rest ) where {O<:Union{NonlinearLeastSquaresObjective,AbstractDecoratedManifoldObjective}} - i_nlso = get_objective(nlso) # undeecorate – for safety + i_nlso = get_objective(nlso) # undecorate – for safety dnlso = decorate_objective!(M, nlso; kwargs...) nlsp = DefaultManoptProblem(M, dnlso) lms = LevenbergMarquardtState( @@ -258,7 +258,7 @@ function step_solver!( lms::LevenbergMarquardtState, i::Integer, ) where {mT<:AbstractManifold} - # o.residual_values is either initialized by initialize_solver! or taken from the previous iteraion + # o.residual_values is either initialized by initialize_solver! or taken from the previous iteration M = get_manifold(dmp) nlso = get_objective(dmp) basis_ox = _maybe_get_basis(M, lms.p, nlso.jacobian_tangent_basis) diff --git a/src/solvers/NelderMead.jl b/src/solvers/NelderMead.jl index 2c2a1592ee..910532dbb1 100644 --- a/src/solvers/NelderMead.jl +++ b/src/solvers/NelderMead.jl @@ -52,7 +52,7 @@ end @doc raw""" NelderMeadState <: AbstractManoptSolverState -Describes all parameters and the state of a Nealer-Mead heuristic based +Describes all parameters and the state of a Nelder-Mead heuristic based optimization algorithm. # Fields @@ -69,14 +69,14 @@ after the description * `ρ` – (`1/2`) contraction parameter, ``0 < ρ ≤ \frac{1}{2}``, * `σ` – (`1/2`) shrink coefficient, ``0 < σ ≤ 1`` * `p` – (`copy(population.pts[1])`) - a field to collect the current best value (initialized to _some_ point here) -* `retraction_method` – (`default_retraction_method(M, typeof(p))`) the rectraction to use. +* `retraction_method` – (`default_retraction_method(M, typeof(p))`) the retraction to use. * `inverse_retraction_method` - (`default_inverse_retraction_method(M, typeof(p))`) an inverse retraction to use. # Constructors NelderMead(M[, population::NelderMeadSimplex]; kwargs...) -Construct a Nelder-Mead Option with a default popultion (if not provided) of set of +Construct a Nelder-Mead Option with a default population (if not provided) of set of `dimension(M)+1` random points stored in [`NelderMeadSimplex`](@ref). In the constructor all fields (besides the population) are keyword arguments. @@ -194,7 +194,7 @@ and * `γ` – (`2.`) expansion parameter (``γ``) * `ρ` – (`1/2`) contraction parameter, ``0 < ρ ≤ \frac{1}{2}``, * `σ` – (`1/2`) shrink coefficient, ``0 < σ ≤ 1`` -* `retraction_method` – (`default_retraction_method(M, typeof(p))`) the rectraction to use +* `retraction_method` – (`default_retraction_method(M, typeof(p))`) the retraction to use * `inverse_retraction_method` - (`default_inverse_retraction_method(M, typeof(p))`) an inverse retraction to use. and the ones that are passed to [`decorate_state!`](@ref) for decorators. @@ -355,9 +355,9 @@ A stopping criterion for [`NelderMead`](@ref) to indicate to stop when both * the maximal distance of the first to the remaining the cost values and -* the maximal diistance of the first to the remaining the population points +* the maximal distance of the first to the remaining the population points -drops below a ceertain tolerance `tol_f` and `tol_p`, respectively. +drops below a certain tolerance `tol_f` and `tol_p`, respectively. # Constructor diff --git a/src/solvers/adaptive_regularization_with_cubics.jl b/src/solvers/adaptive_regularization_with_cubics.jl index 91dcaaf06f..ff85b47993 100644 --- a/src/solvers/adaptive_regularization_with_cubics.jl +++ b/src/solvers/adaptive_regularization_with_cubics.jl @@ -7,14 +7,14 @@ A state for the [`adaptive_regularization_with_cubics`](@ref) solver. a default value is given in brackets if a parameter can be left out in initialization. * `η1`, `η2` – (`0.1`, `0.9`) bounds for evaluating the regularization parameter -* `γ1`, `γ2` – (`0.1`, `2.0`) shrinking and exansion factors for regularization parameter `σ` +* `γ1`, `γ2` – (`0.1`, `2.0`) shrinking and expansion factors for regularization parameter `σ` * `p` – (`rand(M)` the current iterate * `X` – (`zero_vector(M,p)`) the current gradient ``\operatorname{grad}f(p)`` * `s` - (`zero_vector(M,p)`) the tangent vector step resulting from minimizing the model problem in the tangent space ``\mathcal T_{p} \mathcal M`` * `σ` – the current cubic regularization parameter * `σmin` – (`1e-7`) lower bound for the cubic regularization parameter -* `ρ_regularization` – (1e3) regularization paramter for computing ρ. As we approach convergence the ρ may be difficult to compute with numerator and denominator approachign zero. Regularizing the the ratio lets ρ go to 1 near convergence. +* `ρ_regularization` – (1e3) regularization parameter for computing ρ. As we approach convergence the ρ may be difficult to compute with numerator and denominator approaching zero. Regularizing the the ratio lets ρ go to 1 near convergence. * `evaluation` - (`AllocatingEvaluation()`) if you provide a * `retraction_method` – (`default_retraction_method(M)`) the retraction to use * `stopping_criterion` – ([`StopAfterIteration`](@ref)`(100)`) a [`StoppingCriterion`](@ref) @@ -23,7 +23,7 @@ a default value is given in brackets if a parameter can be left out in initializ the problem is an [`AbstractManoptProblem`](@ref) or an [`AbstractEvaluationType`](@ref) if it is a function, where it defaults to [`AllocatingEvaluation`](@ref). -Furthermore the following interal fields are defined +Furthermore the following integral fields are defined * `q` - (`copy(M,p)`) a point for the candidates to evaluate model and ρ * `H` – (`copy(M, p, X)`) the current hessian, $\operatorname{Hess}F(p)[⋅]$ @@ -78,7 +78,7 @@ function AdaptiveRegularizationState( DefaultManoptProblem(M, sub_objective) end, sub_state::St=sub_problem isa Function ? AllocatingEvaluation() : LanczosState(M, p), - σ::R=100.0 / sqrt(manifold_dimension(M)),# Had this to inital value of 0.01. However try same as in MATLAB: 100/sqrt(dim(M)) + σ::R=100.0 / sqrt(manifold_dimension(M)),# Had this to initial value of 0.01. However try same as in MATLAB: 100/sqrt(dim(M)) ρ_regularization::R=1e3, stopping_criterion::SC=StopAfterIteration(100), retraction_method::RTM=default_retraction_method(M), @@ -178,14 +178,14 @@ Let ``X_k`` denote the minimizer of the model ``m_k``, then we use the model imp We use two thresholds ``η_2 ≥ η_1 > 0`` and set ``p_{k+1} = \operatorname{retr}_{p_k}(X_k)`` if ``ρ ≥ η_1`` and reject the candidate otherwise, i.e. set ``p_{k+1} = p_k``. -We further update the regularozation parameter using factors ``0 < γ_1 < 1 < γ_2`` +We further update the regularization parameter using factors ``0 < γ_1 < 1 < γ_2`` ```math σ_{k+1} = \begin{cases} \max\{σ_{\min}, γ_1σ_k\} & \text{ if } ρ \geq η_2 &\text{ (the model was very successful)},\\ - σ_k & \text{ if } ρ \in [η_1, η_2)&\text{ (the model was succesful)},\\ - γ_2σ_k & \text{ if } ρ < η_1&\text{ (the model was unsuccesful)}. + σ_k & \text{ if } ρ \in [η_1, η_2)&\text{ (the model was successful)},\\ + γ_2σ_k & \text{ if } ρ < η_1&\text{ (the model was unsuccessful)}. \end{cases} ``` @@ -221,7 +221,7 @@ the default values are given in brackets * `ρ_regularization` - (`1e3`) a regularization to avoid dividing by zero for small values of cost and model * `stopping_criterion` - ([`StopAfterIteration`](@ref)`(40) | `[`StopWhenGradientNormLess`](@ref)`(1e-9) | `[`StopWhenAllLanczosVectorsUsed`](@ref)`(maxIterLanczos)`) * `sub_state` - [`LanczosState`](@ref)`(M, copy(M, p); maxIterLanczos=maxIterLanczos, σ=σ) - a state for the subproblem or an [`AbstractEvaluationType`](@ref) if the problem is a funtion. + a state for the subproblem or an [`AbstractEvaluationType`](@ref) if the problem is a function. * `sub_objective` - a shortcut to modify the objective of the subproblem used within in the * `sub_problem` - [`DefaultManoptProblem`](@ref)`(M, sub_objective)` the problem (or a function) for the sub problem @@ -517,8 +517,8 @@ Solve the adaptive regularized subproblem with a Lanczos iteration * `σ` – the current regularization parameter * `X` the current gradient * `Lanczos_vectors` – the obtained Lanczos vectors -* `tridig_matrix` the tridigonal coefficient matrix T -* `coefficients` the coefficients `y_1,...y_k`` that deteermine the solution +* `tridig_matrix` the tridiagonal coefficient matrix T +* `coefficients` the coefficients `y_1,...y_k`` that determine the solution * `Hp` – a temporary vector containing the evaluation of the Hessian * `Hp_residual` – a temporary vector containing the residual to the Hessian * `S` – the current obtained / approximated solution @@ -630,7 +630,7 @@ function step_solver!(dmp::AbstractManoptProblem, ls::LanczosState, i) end get_hessian!(M, ls.Hp, mho, ls.p, ls.Lanczos_vectors[1]) α = inner(M, ls.p, ls.Lanczos_vectors[1], ls.Hp) - # This is also the first coefficient in the tridigianoal matrix + # This is also the first coefficient in the tridiagonal matrix ls.tridig_matrix[1, 1] = α ls.Hp_residual .= ls.Hp - α * ls.Lanczos_vectors[1] #argmin of one dimensional model @@ -793,7 +793,7 @@ end @doc raw""" StopWhenAllLanczosVectorsUsed <: StoppingCriterion -When an inner iteration has used up all Lanczos vectors, then this stoping crtierion is +When an inner iteration has used up all Lanczos vectors, then this stopping criterion is a fallback / security stopping criterion in order to not access a non-existing field in the array allocated for vectors. diff --git a/src/solvers/alternating_gradient_descent.jl b/src/solvers/alternating_gradient_descent.jl index cdb7a1fafb..61235d5faa 100644 --- a/src/solvers/alternating_gradient_descent.jl +++ b/src/solvers/alternating_gradient_descent.jl @@ -119,7 +119,7 @@ function (ag::AlternatingGradient)( (i == 1) && zero_vector!(M, ag.dir, agds.p) # update order(k)th component inplace get_gradient!(amp, ag.dir[M, agds.order[agds.k]], agds.p, agds.order[agds.k]) - return agds.stepsize(amp, agds, i), ag.dir # return urrent full gradient + return agds.stepsize(amp, agds, i), ag.dir # return current full gradient end # update Armijo to work on the kth gradient only. diff --git a/src/solvers/augmented_Lagrangian_method.jl b/src/solvers/augmented_Lagrangian_method.jl index eb276fc14a..5a6bcda465 100644 --- a/src/solvers/augmented_Lagrangian_method.jl +++ b/src/solvers/augmented_Lagrangian_method.jl @@ -205,7 +205,7 @@ where ``θ_ρ \in (0,1)`` is a constant scaling factor. * `grad_g` – (`nothing`) the gradient of the inequality constraints * `grad_h` – (`nothing`) the gradient of the equality constraints -Note that one of the pairs (`g`, `grad_g`) or (`h`, `grad_h`) has to be proviede. +Note that one of the pairs (`g`, `grad_g`) or (`h`, `grad_h`) has to be provided. Otherwise the problem is not constrained and you can also call e.g. [`quasi_Newton`](@ref) # Optional @@ -223,8 +223,8 @@ Otherwise the problem is not constrained and you can also call e.g. [`quasi_Newt * `τ` – (`0.8`) factor for the improvement of the evaluation of the penalty parameter * `ρ` – (`1.0`) the penalty parameter * `θ_ρ` – (`0.3`) the scaling factor of the penalty parameter -* `sub_cost` – ([`AugmentedLagrangianCost`](@ref)`(problem, ρ, μ, λ)`) use augmented Lagranian, expecially with the same numbers `ρ,μ` as in the options for the sub problem -* `sub_grad` – ([`AugmentedLagrangianGrad`](@ref)`(problem, ρ, μ, λ)`) use augmented Lagranian gradient, expecially with the same numbers `ρ,μ` as in the options for the sub problem +* `sub_cost` – ([`AugmentedLagrangianCost`](@ref)`(problem, ρ, μ, λ)`) use augmented Lagrangian, especially with the same numbers `ρ,μ` as in the options for the sub problem +* `sub_grad` – ([`AugmentedLagrangianGrad`](@ref)`(problem, ρ, μ, λ)`) use augmented Lagrangian gradient, especially with the same numbers `ρ,μ` as in the options for the sub problem * `sub_kwargs` – keyword arguments to decorate the sub options, e.g. with debug. * `sub_stopping_criterion` – ([`StopAfterIteration`](@ref)`(200) | `[`StopWhenGradientNormLess`](@ref)`(ϵ) | `[`StopWhenStepsizeLess`](@ref)`(1e-8)`) specify a stopping criterion for the subsolver. * `sub_problem` – ([`DefaultManoptProblem`](@ref)`(M, `[`ConstrainedManifoldObjective`](@ref)`(subcost, subgrad; evaluation=evaluation))`) problem for the subsolver diff --git a/src/solvers/conjugate_gradient_descent.jl b/src/solvers/conjugate_gradient_descent.jl index 622bea96fb..f4e8b6bbd7 100644 --- a/src/solvers/conjugate_gradient_descent.jl +++ b/src/solvers/conjugate_gradient_descent.jl @@ -42,7 +42,7 @@ and one can employ different rules to update the descent direction ``δ_k`` base the last direction ``δ_{k-1}`` and both gradients ``\operatorname{grad}f(x_k)``,``\operatorname{grad}f(x_{k-1})``. The [`Stepsize`](@ref) ``s_k`` may be determined by a [`Linesearch`](@ref). -Alternatively to `f` and `grad_f` you can prodive +Alternatively to `f` and `grad_f` you can provide the [`AbstractManifoldGradientObjective`](@ref) `gradient_objective` directly. Available update rules are [`SteepestDirectionUpdateRule`](@ref), which yields a [`gradient_descent`](@ref), @@ -133,7 +133,7 @@ where ``\operatorname{retr}`` denotes a retraction on the `Manifold` `M` * `grad_f`: the gradient ``\operatorname{grad}F:\mathcal M→ T\mathcal M`` of F * `p` : an initial value ``p∈\mathcal M`` -Alternatively to `f` and `grad_f` you can prodive +Alternatively to `f` and `grad_f` you can provide the [`AbstractManifoldGradientObjective`](@ref) `gradient_objective` directly. for more details and options, especially the [`DirectionUpdateRule`](@ref)s, diff --git a/src/solvers/cyclic_proximal_point.jl b/src/solvers/cyclic_proximal_point.jl index d60e5e6f68..54419f130b 100644 --- a/src/solvers/cyclic_proximal_point.jl +++ b/src/solvers/cyclic_proximal_point.jl @@ -68,7 +68,7 @@ function cyclic_proximal_point( evaluation::AbstractEvaluationType=AllocatingEvaluation(), kwargs..., ) - # redefine our initial point and encapsulate functons + # redefine our initial point and encapsulate functions q = [p] f_(M, p) = f(M, p[]) if evaluation isa AllocatingEvaluation diff --git a/src/solvers/difference-of-convex-proximal-point.jl b/src/solvers/difference-of-convex-proximal-point.jl index a47ba8fcc3..b36f254c62 100644 --- a/src/solvers/difference-of-convex-proximal-point.jl +++ b/src/solvers/difference-of-convex-proximal-point.jl @@ -6,8 +6,8 @@ It comes in two forms, depending on the realisation of the `subproblem`. # Fields * `inverse_retraction_method` – (`default_inverse_retraction_method(M)`) an inverse retraction method to use within Frank Wolfe. * `retraction_method` – (`default_retraction_method(M)`) a type of retraction -* `p`, `q`, `r` – the current iterate, the gradient step and the prox, respetively - their type is set by intializing `p` +* `p`, `q`, `r` – the current iterate, the gradient step and the prox, respectively + their type is set by initializing `p` * `stepsize` – ([`ConstantStepsize`](@ref)`(1.0)`) a [`Stepsize`](@ref) function to run the modified algorithm (experimental) * `stop` – ([`StopWhenChangeLess`](@ref)`(1e-8)`) a [`StoppingCriterion`](@ref) * `X`, `Y` – (`zero_vector(M,p)`) the current gradient and descent direction, respectively @@ -130,7 +130,7 @@ Compute the difference of convex proximal point algorithm [Souza, Oliveira, J. G where you have to provide the (sub) gradient ``∂h`` of ``h`` and either * the proximal map ``\operatorname{prox}_{\lambda g}`` of `g` as a function `prox_g(M, λ, p)` or `prox_g(M, q, λ, p)` * the functions `g` and `grad_g` to compute the proximal map using a sub solver -* your own sub-solver, see optional keywods below +* your own sub-solver, see optional keywords below This algorithm performs the following steps given a start point `p`= ``p^{(0)}``. @@ -183,18 +183,18 @@ difference_of_convex_proximal_point(M, grad_h, p0; g=g, grad_g=grad_g) * `sub_grad` – ([`ProximalDCGrad`](@ref)`(grad_g, copy(M, p), λ(1); evaluation=evaluation)` gradient to be used within the default `sub_problem`, that is initialized as soon as `grad_g` is provided. This is generated by default when `grad_g` is provided. You can specify your own by overwriting this keyword. -* `sub_hess` – (a fininte difference approximation by default) specify +* `sub_hess` – (a finite difference approximation by default) specify a Hessian of the subproblem, which the default solver, see `sub_state` needs * `sub_kwargs` – (`[]`) pass keyword arguments to the `sub_state`, in form of a `Dict(:kwname=>value)`, unless you set the `sub_state` directly. -* `sub_objective` – (a gradient or hessian objetive based on the last 3 keywords) +* `sub_objective` – (a gradient or hessian objective based on the last 3 keywords) provide the objective used within `sub_problem` (if that is not specified by the user) * `sub_problem` – ([`DefaultManoptProblem`](@ref)`(M, sub_objective)` specify a manopt problem for the sub-solver runs. You can also provide a function for a closed form solution. Then `evaluation=` is taken into account for the form of this function. * `sub_state` – ([`TrustRegionsState`](@ref) – requires the `sub_hessian to be provided, decorated with `sub_kwargs`) choose the solver by specifying a solver state to solve the `sub_problem` * `sub_stopping_criterion` - ([`StopAfterIteration`](@ref)`(300) | `[`StopWhenStepsizeLess`](@ref)`(1e-9) | `[`StopWhenGradientNormLess`](@ref)`(1e-9)`) - a stopping crierion used withing the default `sub_state=` + a stopping criterion used withing the default `sub_state=` ...all others are passed on to decorate the inner [`DifferenceOfConvexProximalState`](@ref). @@ -278,7 +278,7 @@ Compute the difference of convex algorithm to minimize where you have to provide the proximal map of `g` and the gradient of `h`. -The compuation is done inplace of `p`. +The computation is done inplace of `p`. For all further details, especially the keyword arguments, see [`difference_of_convex_proximal_point`](@ref). """ @@ -376,7 +376,7 @@ function difference_of_convex_proximal_point!( if isnothing(sub_problem) error( """ - The `sub_problem` is not correctly intialized. Provie _one of_ the following setups + The `sub_problem` is not correctly initialized. Provie _one of_ the following setups * `prox_g` as a closed form solution, * `g=` and `grad_g=` keywords to automatically generate the sub cost and gradient, * provide individual `sub_cost=` and `sub_grad=` to automatically generate the sub objective, diff --git a/src/solvers/difference_of_convex_algorithm.jl b/src/solvers/difference_of_convex_algorithm.jl index 0309e80b6d..936776a28b 100644 --- a/src/solvers/difference_of_convex_algorithm.jl +++ b/src/solvers/difference_of_convex_algorithm.jl @@ -138,13 +138,13 @@ until the `stopping_criterion` is fulfilled. allocation (default) form `grad_f(M, p)` or [`InplaceEvaluation`](@ref) form `grad_f!(M, X, x)` * `gradient` – (`nothing`) specify ``\operatorname{grad} f``, for debug / analysis or enhancing `stopping_criterion=` * `grad_g` – (`nothing`) specify the gradient of `g`. If specified, a subsolver is automatically set up. -* `initial_vector` - (`zero_vector(M, p)`) initialise the inner tangent vecor to store the subgradient result. +* `initial_vector` - (`zero_vector(M, p)`) initialise the inner tangent vector to store the subgradient result. * `stopping_criterion` – ([`StopAfterIteration`](@ref)`(200) | `[`StopWhenChangeLess`](@ref)`(1e-8)`) a [`StoppingCriterion`](@ref) for the algorithm – includes a [`StopWhenGradientNormLess`](@ref)`(1e-8)`, when a `gradient` is provided. if you specify the [`ManifoldDifferenceOfConvexObjective`](@ref) `mdco`, additionally -* `g` - (`nothing`) speficy the function `g` If specified, a subsolver is automatically set up. +* `g` - (`nothing`) specify the function `g` If specified, a subsolver is automatically set up. While there are several parameters for a sub solver, the easiest is to provide the function `grad_g=`, @@ -163,11 +163,11 @@ difference_of_convex_algorithm(M, f, g, grad_h, p; grad_g=grad_g) * `sub_grad` - ([`LinearizedDCGrad`](@ref)`(grad_g, p, initial_vector; evaluation=evaluation)` gradient to be used within the default `sub_problem`. This is generated by default when `grad_g` is provided. You can specify your own by overwriting this keyword. -* `sub_hess` – (a fininte difference approximation by default) specify a Hessian +* `sub_hess` – (a finite difference approximation by default) specify a Hessian of the subproblem, which the default solver, see `sub_state` needs * `sub_kwargs` - (`[]`) pass keyword arguments to the `sub_state`, in form of a `Dict(:kwname=>value)`, unless you set the `sub_state` directly. -* `sub_objective` - (a gradient or hessian objetive based on the last 3 keywords) +* `sub_objective` - (a gradient or hessian objective based on the last 3 keywords) provide the objective used within `sub_problem` (if that is not specified by the user) * `sub_problem` - ([`DefaultManoptProblem`](@ref)`(M, sub_objective)` specify a manopt problem for the sub-solver runs. You can also provide a function for a closed form solution. Then `evaluation=` is taken into account for the form of this function. @@ -176,7 +176,7 @@ difference_of_convex_algorithm(M, f, g, grad_h, p; grad_g=grad_g) if the `sub_problem` if a function (i.e. a closed form solution), this is set to `evaluation` and can be changed to the evaluation type of the closed form solution accordingly. * `sub_stopping_criterion` - ([`StopAfterIteration`](@ref)`(300) | `[`StopWhenStepsizeLess`](@ref)`(1e-9) | `[`StopWhenGradientNormLess`](@ref)`(1e-9)`) - a stopping crierion used withing the default `sub_state=` + a stopping criterion used withing the default `sub_state=` * `sub_stepsize` - ([`ArmijoLinesearch`](@ref)`(M)`) specify a step size used within the `sub_state` ...all others are passed on to decorate the inner [`DifferenceOfConvexState`](@ref). @@ -346,7 +346,7 @@ function difference_of_convex_algorithm!( if isnothing(sub_problem) error( """ - Subproblem not correctly intialized. Please provide _either_ + Subproblem not correctly initialized. Please provide _either_ * a `sub_problem=` to be solved * a `sub_objective` to automatically generate the sub problem, * `sub_grad=` (as well as the usually given `sub_cost=`) to automatically generate the sub objective _or_ @@ -401,7 +401,7 @@ function step_solver!( return dcs end # -# Variant II: subtask is a mutating function providing a closed form soltuion +# Variant II: subtask is a mutating function providing a closed form solution # function step_solver!( amp::AbstractManoptProblem, @@ -414,7 +414,7 @@ function step_solver!( return dcs end # -# Variant II: subtask is an allocating function providing a closed form soltuion +# Variant II: subtask is an allocating function providing a closed form solution # function step_solver!( amp::AbstractManoptProblem, diff --git a/src/solvers/exact_penalty_method.jl b/src/solvers/exact_penalty_method.jl index 77a98bf998..8da9ddeee7 100644 --- a/src/solvers/exact_penalty_method.jl +++ b/src/solvers/exact_penalty_method.jl @@ -179,7 +179,7 @@ where ``θ_ρ \in (0,1)`` is a constant scaling factor. * `grad_g` – (`nothing`) the gradient of the inequality constraints * `grad_h` – (`nothing`) the gradient of the equality constraints -Note that one of the pairs (`g`, `grad_g`) or (`h`, `grad_h`) has to be proviede. +Note that one of the pairs (`g`, `grad_g`) or (`h`, `grad_h`) has to be provided. Otherwise the problem is not constrained and you can also call e.g. [`quasi_Newton`](@ref) # Optional @@ -193,8 +193,8 @@ Otherwise the problem is not constrained and you can also call e.g. [`quasi_Newt * `u_min` – (`1e-6`) the lower bound for the smoothing parameter and threshold for violation of the constraints * `ρ` – (`1.0`) the penalty parameter * `min_stepsize` – (`1e-10`) the minimal step size -* `sub_cost` – ([`ExactPenaltyCost`](@ref)`(problem, ρ, u; smoothing=smoothing)`) use this exact penality cost, expecially with the same numbers `ρ,u` as in the options for the sub problem -* `sub_grad` – ([`ExactPenaltyGrad`](@ref)`(problem, ρ, u; smoothing=smoothing)`) use this exact penality gradient, expecially with the same numbers `ρ,u` as in the options for the sub problem +* `sub_cost` – ([`ExactPenaltyCost`](@ref)`(problem, ρ, u; smoothing=smoothing)`) use this exact penalty cost, especially with the same numbers `ρ,u` as in the options for the sub problem +* `sub_grad` – ([`ExactPenaltyGrad`](@ref)`(problem, ρ, u; smoothing=smoothing)`) use this exact penalty gradient, especially with the same numbers `ρ,u` as in the options for the sub problem * `sub_kwargs` – keyword arguments to decorate the sub options, e.g. with debug. * `sub_stopping_criterion` – ([`StopAfterIteration`](@ref)`(200) | `[`StopWhenGradientNormLess`](@ref)`(ϵ) | `[`StopWhenStepsizeLess`](@ref)`(1e-10)`) specify a stopping criterion for the subsolver. * `sub_problem` – ([`DefaultManoptProblem`](@ref)`(M, `[`ManifoldGradientObjective`](@ref)`(sub_cost, sub_grad; evaluation=evaluation)` – ` problem for the subsolver diff --git a/src/solvers/gradient_descent.jl b/src/solvers/gradient_descent.jl index 58e3076182..e322329886 100644 --- a/src/solvers/gradient_descent.jl +++ b/src/solvers/gradient_descent.jl @@ -132,7 +132,7 @@ with different choices of the stepsize ``s_k`` available (see `stepsize` option - as a function `(M, p) -> X` or a function `(M, X, p) -> X` * `p` – an initial value `p` ``= p_0 ∈ \mathcal M`` -Alternatively to `f` and `grad_f` you can prodive +Alternatively to `f` and `grad_f` you can provide the [`AbstractManifoldGradientObjective`](@ref) `gradient_objective` directly. # Optional @@ -212,7 +212,7 @@ in place of `p` with different choices of ``s_k`` available. * `grad_f` – the gradient ``\operatorname{grad}F:\mathcal M→ T\mathcal M`` of F * `p` – an initial value ``p ∈ \mathcal M`` -Alternatively to `f` and `grad_f` you can prodive +Alternatively to `f` and `grad_f` you can provide the [`AbstractManifoldGradientObjective`](@ref) `gradient_objective` directly. For more options, especially [`Stepsize`](@ref)s for ``s_k``, see [`gradient_descent`](@ref) diff --git a/src/solvers/particle_swarm.jl b/src/solvers/particle_swarm.jl index 20160bd35c..b9be3eda94 100644 --- a/src/solvers/particle_swarm.jl +++ b/src/solvers/particle_swarm.jl @@ -10,7 +10,7 @@ Describes a particle swarm optimizing algorithm, with * `x` – a set of points (of type `AbstractVector{P}`) on a manifold as initial particle positions * `velocity` – a set of tangent vectors (of type `AbstractVector{T}`) representing the velocities of the particles -* `inertia` – (`0.65`) the inertia of the patricles +* `inertia` – (`0.65`) the inertia of the particles * `social_weight` – (`1.4`) a social weight factor * `cognitive_weight` – (`1.4`) a cognitive weight factor * `p_temp` – temporary storage for a point to avoid allocations during a step of the algorithm @@ -18,7 +18,7 @@ Describes a particle swarm optimizing algorithm, with * `cognitive_vector` - temporary storage for a tangent vector related to `cognitive_weight` * `stopping_criterion` – (`[`StopAfterIteration`](@ref)`(500) | `[`StopWhenChangeLess`](@ref)`(1e-4)`) a functor inheriting from [`StoppingCriterion`](@ref) indicating when to stop. -* `retraction_method` – (`default_retraction_method(M, eltype(x))`) the rectraction to use +* `retraction_method` – (`default_retraction_method(M, eltype(x))`) the retraction to use * `inverse_retraction_method` - (`default_inverse_retraction_method(M, eltype(x))`) an inverse retraction to use. * `vector_transport_method` - (`default_vector_transport_method(M, eltype(x))`) a vector transport to use @@ -193,7 +193,7 @@ Instead of a cost function `f` you can also provide an [`AbstractManifoldCostObj # Optional * `cognitive_weight` – (`1.4`) a cognitive weight factor -* `inertia` – (`0.65`) the inertia of the patricles +* `inertia` – (`0.65`) the inertia of the particles * `inverse_retraction_method` - (`default_inverse_retraction_method(M, eltype(x))`) an `inverse_retraction(M,x,y)` to use. * `swarm_size` - (`100`) number of random initial positions of x0 * `retraction_method` – (`default_retraction_method(M, eltype(x))`) a `retraction(M,x,ξ)` to use. @@ -201,7 +201,7 @@ Instead of a cost function `f` you can also provide an [`AbstractManifoldCostObj * `stopping_criterion` – ([`StopWhenAny`](@ref)`(`[`StopAfterIteration`](@ref)`(500)`, [`StopWhenChangeLess`](@ref)`(10^{-4})))` a functor inheriting from [`StoppingCriterion`](@ref) indicating when to stop. * `vector_transport_mthod` - (`default_vector_transport_method(M, eltype(x))`) a vector transport method to use. -* `velocity` – a set of tangent vectors (of type `AbstractVector{T}`) representing the velocities of the particles, per default a random tangent vector per inital position +* `velocity` – a set of tangent vectors (of type `AbstractVector{T}`) representing the velocities of the particles, per default a random tangent vector per initial position All other keyword arguments are passed to [`decorate_state!`](@ref) for decorators or [`decorate_objective!`](@ref), respectively. @@ -256,7 +256,7 @@ end patricle_swarm!(M, f, swarm; kwargs...) patricle_swarm!(M, mco::AbstractManifoldCostObjective, swarm; kwargs..) -perform the particle swarm optimization algorithm (PSO), starting with the initial `swarm` whichis then modified in place. +perform the particle swarm optimization algorithm (PSO), starting with the initial `swarm` which is then modified in place. # Input diff --git a/src/solvers/primal_dual_semismooth_Newton.jl b/src/solvers/primal_dual_semismooth_Newton.jl index da050822df..3976e58bed 100644 --- a/src/solvers/primal_dual_semismooth_Newton.jl +++ b/src/solvers/primal_dual_semismooth_Newton.jl @@ -30,7 +30,7 @@ Note that this changes the arguments the `forward_operator` will be called. * `stopping_criterion` – (`stopAtIteration(50)`) a [`StoppingCriterion`](@ref) * `update_primal_base` – (`missing`) function to update `m` (identity by default/missing) * `update_dual_base` – (`missing`) function to update `n` (identity by default/missing) -* `retraction_method` – (`default_retraction_method(M, typeof(p))`) the rectraction to use +* `retraction_method` – (`default_retraction_method(M, typeof(p))`) the retraction to use * `inverse_retraction_method` - (`default_inverse_retraction_method(M, typeof(p))`) an inverse retraction to use. * `vector_transport_method` - (`default_vector_transport_method(M, typeof(p))`) a vector transport to use diff --git a/src/solvers/quasi_Newton.jl b/src/solvers/quasi_Newton.jl index 69c9e47625..30bb5f8bff 100644 --- a/src/solvers/quasi_Newton.jl +++ b/src/solvers/quasi_Newton.jl @@ -363,7 +363,7 @@ end @doc raw""" update_hessian!(d, amp, st, p_old, iter) -update the hessian wihtin the [`QuasiNewtonState`](@ref) `o` given a [`AbstractManoptProblem`](@ref) `amp` +update the hessian within the [`QuasiNewtonState`](@ref) `o` given a [`AbstractManoptProblem`](@ref) `amp` as well as the an [`AbstractQuasiNewtonDirectionUpdate`](@ref) `d` and the last iterate `p_old`. Note that the current (`iter`th) iterate is already stored in `o.x`. @@ -572,7 +572,7 @@ function update_hessian!( M = get_manifold(mp) p = get_iterate(st) X = get_gradient(st) - # computing the bound used in the decission rule + # computing the bound used in the decision rule bound = d.θ(norm(M, p, X)) sk_normsq = norm(M, p, st.sk)^2 if sk_normsq != 0 && (inner(M, p, st.sk, st.yk) / sk_normsq) >= bound @@ -614,17 +614,17 @@ function update_hessian!( p_old, iter, ) - # computing the bound used in the decission rule + # computing the bound used in the decision rule M = get_manifold(mp) p = get_iterate(st) bound = d.θ(norm(M, p_old, get_gradient(mp, p_old))) sk_normsq = norm(M, p, st.sk)^2 - # if the decission rule is fulfilled, the new sk and yk are added + # if the decision rule is fulfilled, the new sk and yk are added if sk_normsq != 0 && (inner(M, p, st.sk, st.yk) / sk_normsq) >= bound update_hessian!(d.update, mp, st, p_old, iter) else - # the stored vectores are just transported to the new tangent space, sk and yk are not added + # the stored vectors are just transported to the new tangent space, sk and yk are not added for i in 1:length(d.update.memory_s) vector_transport_to!( M, diff --git a/src/solvers/solver.jl b/src/solvers/solver.jl index e41e2b62f4..d5aec8f7fc 100644 --- a/src/solvers/solver.jl +++ b/src/solvers/solver.jl @@ -10,7 +10,7 @@ one is used to activate certain decorators. * `debug` – (`Array{Union{Symbol,DebugAction,String,Int},1}()`) a set of symbols representing [`DebugAction`](@ref)s, `Strings` used as dividers and a subsampling integer. These are passed as a [`DebugGroup`](@ref) within `:All` to the - [`DebugSolverState`](@ref) decorator dictionary. Only excention is `:Stop` that is passed to `:Stop`. + [`DebugSolverState`](@ref) decorator dictionary. Only exception is `:Stop` that is passed to `:Stop`. * `record` – (`Array{Union{Symbol,RecordAction,Int},1}()`) specify recordings by using `Symbol`s or [`RecordAction`](@ref)s directly. The integer can again be used for only recording every ``i``th iteration. @@ -38,7 +38,7 @@ function decorate_state!( RecordAction, # single action Array{RecordAction,1}, # a group to be set in :All Dict{Symbol,RecordAction}, # a dictionary for precise settings - Array{<:Any,1}, # a formated string with symbols or AbstractStateActions + Array{<:Any,1}, # a formatted string with symbols or AbstractStateActions }=missing, return_state=false, kwargs..., # ignore all others @@ -64,14 +64,14 @@ decorate the [`AbstractManifoldObjective`](@ref)` o` with specific decorators. optional arguments provide necessary details on the decorators. A specific one is used to activate certain decorators. -* `cache` – (`missing`) specify a cache. Currenlty `:Simple` is supported and `:LRU` if you +* `cache` – (`missing`) specify a cache. Currently `:Simple` is supported and `:LRU` if you load `LRUCache.jl`. For this case a tuple specifying what to cache and how many can be provided, i.e. `(:LRU, [:Cost, :Gradient], 10)`, where the number specifies the size of each cache. and 10 is the default if one omits the last tuple entry * `count` – (`missing`) specify calls to the objective to be called, see [`ManifoldCountObjective`](@ref) for the full list * `objective_type` – (`:Riemannian`) specify that an objective is `:Riemannian` or `:Euclidean`. The `:Euclidean` symbol is equivalent to specifying it as `:Embedded`, - since in the end, both refer to convertiing an objective from the embedding (whether its Euclidean or not) + since in the end, both refer to converting an objective from the embedding (whether its Euclidean or not) to the Riemannian one. # See also diff --git a/src/solvers/truncated_conjugate_gradient_descent.jl b/src/solvers/truncated_conjugate_gradient_descent.jl index a60169b8ed..d962de7a20 100644 --- a/src/solvers/truncated_conjugate_gradient_descent.jl +++ b/src/solvers/truncated_conjugate_gradient_descent.jl @@ -107,7 +107,7 @@ function show(io::IO, tcgs::TruncatedConjugateGradientState) end # -# Spcial stopping Criteria +# Special stopping Criteria # @doc raw""" @@ -480,7 +480,7 @@ function truncated_conjugate_gradient_descent( M::AbstractManifold, f, grad_f, - Hess_f::TH, #we first fill a default below bwfore dispatching on p::Number + Hess_f::TH, #we first fill a default below before dispatching on p::Number p::Number, X::Number; evaluation::AbstractEvaluationType=AllocatingEvaluation(), @@ -640,7 +640,7 @@ end ) # -# Maybe these could be improved a bit in readablility some time +# Maybe these could be improved a bit in readability some time # function initialize_solver!( mp::AbstractManoptProblem, tcgs::TruncatedConjugateGradientState diff --git a/src/solvers/trust_regions.jl b/src/solvers/trust_regions.jl index c290b86e48..05d838e31d 100644 --- a/src/solvers/trust_regions.jl +++ b/src/solvers/trust_regions.jl @@ -195,7 +195,7 @@ end trust_regions(M, f, grad_f, hess_f, p) trust_regions(M, f, grad_f, p) -run the Riemannian trust-regions solver for optimization on manifolds to minmize `f` +run the Riemannian trust-regions solver for optimization on manifolds to minimize `f` cf. [[Absil, Baker, Gallivan, FoCM, 2006](@cite AbsilBakerGallivan:2006); [Conn, Gould, Toint, SIAM, 2000](@cite ConnGouldToint:2000)]. For the case that no hessian is provided, the Hessian is computed using finite difference, see @@ -292,7 +292,7 @@ function trust_regions( M::AbstractManifold, f, grad_f, - Hess_f::TH, #we first fill a default below bwfore dispatching on p::Number + Hess_f::TH, #we first fill a default below before dispatching on p::Number p::Number; evaluation::AbstractEvaluationType=AllocatingEvaluation(), preconditioner=(M, p, X) -> X, @@ -552,7 +552,7 @@ function step_solver!(mp::AbstractManoptProblem, trs::TrustRegionsState, i) model_decreased = ρden ≥ 0 # Update the Hessian approximation - i.e. really unwrap the original Hessian function - # and update it if it is an approxiate Hessian. + # and update it if it is an approximate Hessian. update_hessian!(M, get_hessian_function(mho, true), trs.p, trs.p_proposal, trs.η) # Choose the new TR radius based on the model performance. # If the actual decrease is smaller than reduction_threshold of the predicted decrease, diff --git a/test/functions/test_bezier.jl b/test/functions/test_bezier.jl index fc73475e34..342156dfd3 100644 --- a/test/functions/test_bezier.jl +++ b/test/functions/test_bezier.jl @@ -137,7 +137,7 @@ using Manopt, Manifolds, Test @test_throws ErrorException adjoint_differential_bezier_control( M, B, 7.0, zero_vector(M, B[1].pts[1]) ) - # a shortcut to evaluate the adjoint at several points is equal to seperate evals + # a shortcut to evaluate the adjoint at several points is equal to separate evals b = B[2] Xi = [log(M, b.pts[1], b.pts[2]), -log(M, b.pts[4], b.pts[3])] Xs = adjoint_differential_bezier_control(M, b, [0.0, 1.0], Xi) diff --git a/test/plans/test_cache.jl b/test/plans/test_cache.jl index 8b12439837..0aab59655d 100644 --- a/test/plans/test_cache.jl +++ b/test/plans/test_cache.jl @@ -2,7 +2,7 @@ using LinearAlgebra, LRUCache, Manifolds, Manopt, Test, Random include("../utils/dummy_types.jl") -# Three dummy functors that are just meant to cound their calls +# Three dummy functors that are just meant to count their calls mutable struct TestCostCount i::Int end @@ -352,5 +352,5 @@ end Z = similar(X) @test grad_f1!(M, Y, p) == grad_f!(M, Z, p) end - # Other tests are included with their respectives objective tests in the corresponding plans + # Other tests are included with their respective objective tests in the corresponding plans end diff --git a/test/plans/test_constrained_plan.jl b/test/plans/test_constrained_plan.jl index a982a92a48..4d4cb7a009 100644 --- a/test/plans/test_constrained_plan.jl +++ b/test/plans/test_constrained_plan.jl @@ -150,7 +150,7 @@ include("../utils/dummy_types.jl") end end end - @testset "Exact Penaltiy Cost & Grad" begin + @testset "Exact Penalties Cost & Grad" begin u = 1.0 ρ = 0.1 for P in [cofa, cofm, cova, covm] @@ -182,7 +182,7 @@ include("../utils/dummy_types.jl") end end end - @testset "Objetive Decorator passthrough" begin + @testset "Objective Decorator passthrough" begin for obj in [cofa, cofm, cova, covm] ddo = DummyDecoratedObjective(obj) @test get_constraints(M, ddo, p) == get_constraints(M, obj, p) diff --git a/test/plans/test_counts.jl b/test/plans/test_counts.jl index 9b9a8b0226..d42e655bc2 100644 --- a/test/plans/test_counts.jl +++ b/test/plans/test_counts.jl @@ -12,7 +12,7 @@ include("../utils/dummy_types.jl") grad_f(M, p) = project(M, p, 2 * A * p) obj = ManifoldGradientObjective(f, grad_f) c_obj = ManifoldCountObjective(M, obj, [:Cost, :Gradient]) - # function acessors are different since the right is still counting. + # function accessors are different since the right is still counting. @test get_cost_function(obj) != get_cost_function(c_obj) @test get_gradient_function(obj) != get_gradient_function(c_obj) p = [1.0, 0.0, 0.0] diff --git a/test/plans/test_debug.jl b/test/plans/test_debug.jl index f47404d5a5..96bd46be04 100644 --- a/test/plans/test_debug.jl +++ b/test/plans/test_debug.jl @@ -229,7 +229,7 @@ Manopt.get_message(::TestMessageState) = "DebugTest" @test Manopt.status_summary(w1) == ":WarnCost" @test_logs (:warn,) ( :warn, - "Further warnings will be supressed, use DebugWarnIfCostNotFinite(:Always) to get all warnings.", + "Further warnings will be suppressed, use DebugWarnIfCostNotFinite(:Always) to get all warnings.", ) w1(mp, st, 0) w2 = DebugWarnIfCostNotFinite(:Always) @test_logs ( @@ -241,7 +241,7 @@ Manopt.get_message(::TestMessageState) = "DebugTest" @test repr(w3) == "DebugWarnIfFieldNotFinite(:X)" @test_logs (:warn,) ( :warn, - "Further warnings will be supressed, use DebugWaranIfFieldNotFinite(:X, :Always) to get all warnings.", + "Further warnings will be suppressed, use DebugWaranIfFieldNotFinite(:X, :Always) to get all warnings.", ) w3(mp, st, 0) w4 = DebugWarnIfFieldNotFinite(:X, :Always) @test_logs ( diff --git a/test/plans/test_difference_of_convex_plan.jl b/test/plans/test_difference_of_convex_plan.jl index 189c0a28ec..6a91050b18 100644 --- a/test/plans/test_difference_of_convex_plan.jl +++ b/test/plans/test_difference_of_convex_plan.jl @@ -12,7 +12,7 @@ include("../utils/dummy_types.jl") dc_obj = ManifoldDifferenceOfConvexObjective(f, grad_h) dcp_obj = ManifoldDifferenceOfConvexProximalObjective(grad_h; cost=f) - @testset "Objetive Decorator passthrough" begin + @testset "Objective Decorator passthrough" begin for obj in [dc_obj, dcp_obj] ddo = DummyDecoratedObjective(obj) X = get_subtrahend_gradient(M, ddo, p) diff --git a/test/plans/test_gradient_plan.jl b/test/plans/test_gradient_plan.jl index 4f76ac538d..2e66cc94b6 100644 --- a/test/plans/test_gradient_plan.jl +++ b/test/plans/test_gradient_plan.jl @@ -21,7 +21,7 @@ include("../utils/dummy_types.jl") @test get_initial_stepsize(mp, gst) == 1.0 @test get_stepsize(mp, gst, 1) == 1.0 @test get_last_stepsize(mp, gst, 1) == 1.0 - # Check Fallbacks of Problen + # Check Fallbacks of Problem @test get_cost(mp, gst.p) == 0.0 @test get_gradient(mp, gst.p) == zero_vector(M, p) @test_throws MethodError get_proximal_map(mp, 1.0, gst.p, 1) @@ -86,7 +86,7 @@ include("../utils/dummy_types.jl") @test get_count(cmcgo, :Gradient) == 3 @test get_count(cmcgo, :Cost) == 3 end - @testset "Objetive Decorator passthrough" begin + @testset "Objective Decorator passthrough" begin ddo = DummyDecoratedObjective(mgo) @test get_cost(M, mgo, p) == get_cost(M, ddo, p) @test get_gradient(M, mgo, p) == get_gradient(M, ddo, p) diff --git a/test/plans/test_hessian_plan.jl b/test/plans/test_hessian_plan.jl index b5d04e60d5..7214b904d4 100644 --- a/test/plans/test_hessian_plan.jl +++ b/test/plans/test_hessian_plan.jl @@ -35,7 +35,7 @@ include("../utils/dummy_types.jl") get_preconditioner!(mp, Y, p, X) @test Y == X end - @testset "Objetive Decorator passthrough" begin + @testset "Objective Decorator passthrough" begin Y1 = zero_vector(M, p) Y2 = zero_vector(M, p) for obj in [mho1, mho2, mho3, mho4] @@ -117,7 +117,7 @@ include("../utils/dummy_types.jl") P[1:9] .= 1 PA = P .* A f2(M, p) = 0.5 * norm(P .* embed(M, p) - PA)^2 - # Project convecrts the Gradient in the Embedding to an UMVTVector + # Project converts the Gradient in the Embedding to an UMVTVector grad_f2(M, p) = project(M, p, P .* embed(M, p) - PA) grad_f2!(M, X, p) = project!(M, X, p, P .* embed(M, p) - PA) Random.seed!(42) diff --git a/test/plans/test_primal_dual_plan.jl b/test/plans/test_primal_dual_plan.jl index 070358d477..1ebb2b0402 100644 --- a/test/plans/test_primal_dual_plan.jl +++ b/test/plans/test_primal_dual_plan.jl @@ -275,7 +275,7 @@ include("../utils/dummy_types.jl") @test length(get_record(r)) == 1 end end - @testset "Objetive Decorator passthrough" begin + @testset "Objective Decorator passthrough" begin # PD pdmo = PrimalDualManifoldObjective( f, prox_f, prox_g_dual, adjoint_DΛ; Λ=Λ, linearized_forward_operator=DΛ diff --git a/test/plans/test_proximal_plan.jl b/test/plans/test_proximal_plan.jl index 23313399a5..7beb1a3cb9 100644 --- a/test/plans/test_proximal_plan.jl +++ b/test/plans/test_proximal_plan.jl @@ -16,7 +16,7 @@ include("../utils/dummy_types.jl") f(M, p) = sum(distance(M, p, q) for q in Q) proxes_f = Tuple((N, λ, p) -> prox_distance(N, λ, q, p) for q in Q) ppo = ManifoldProximalMapObjective(f, proxes_f) - @testset "Objetive Decorator passthrough" begin + @testset "Objective Decorator passthrough" begin dppo = DummyDecoratedObjective(ppo) for i in 1:2 @test get_proximal_map(M, ppo, 0.1, p, i) == diff --git a/test/plans/test_stochastic_gradient_plan.jl b/test/plans/test_stochastic_gradient_plan.jl index 7403cfd8fa..6bbc5e1a18 100644 --- a/test/plans/test_stochastic_gradient_plan.jl +++ b/test/plans/test_stochastic_gradient_plan.jl @@ -18,7 +18,7 @@ include("../utils/dummy_types.jl") msgo_vf = ManifoldStochasticGradientObjective(sgrad_f2; cost=f) msgo_fv = ManifoldStochasticGradientObjective(sgrad_f1; cost=f2) msgo_vv = ManifoldStochasticGradientObjective(sgrad_f2; cost=f2) - @testset "Elementwide Cost access" begin + @testset "Elementwise Cost access" begin for msgo in [msgo_ff, msgo_vf] @test get_cost(M, msgo, p) == get_cost(M, msgo, p, 1) @test_throws ErrorException get_cost(M, msgo, p, 2) @@ -29,7 +29,7 @@ include("../utils/dummy_types.jl") end end end - @testset "Objetive Decorator passthrough" begin + @testset "Objective Decorator passthrough" begin X = zero_vector(M, p) Y = zero_vector(M, p) Xa = [zero_vector(M, p) for p in pts] @@ -48,7 +48,7 @@ include("../utils/dummy_types.jl") end end end - @testset "Count Objetive" begin + @testset "Count Objective" begin X = zero_vector(M, p) Y = zero_vector(M, p) Xa = [zero_vector(M, p) for p in pts] @@ -71,7 +71,7 @@ include("../utils/dummy_types.jl") @test get_count(ddo, :StochasticGradients) == 2 end end - @testset "Cache Objetive" begin + @testset "Cache Objective" begin X = zero_vector(M, p) Y = zero_vector(M, p) Xa = [zero_vector(M, p) for p in pts] diff --git a/test/plans/test_stopping_criteria.jl b/test/plans/test_stopping_criteria.jl index 98dda9bf28..fd2e729ffb 100644 --- a/test/plans/test_stopping_criteria.jl +++ b/test/plans/test_stopping_criteria.jl @@ -43,7 +43,7 @@ struct DummyStoppingCriterion <: StoppingCriterion end @test length(m.captures) == 2 # both have to be active update_stopping_criterion!(s3, :MinCost, 1e-2) @test s3.threshold == 1e-2 - # Dummy withoout iterations has a reasonable fallback + # Dummy without iterations has a reasonable fallback @test Manopt.get_count(DummyStoppingCriterion(), Val(:Iterations)) == 0 end diff --git a/test/plans/test_subgradient_plan.jl b/test/plans/test_subgradient_plan.jl index 821c7da1c1..be1e5412ef 100644 --- a/test/plans/test_subgradient_plan.jl +++ b/test/plans/test_subgradient_plan.jl @@ -11,7 +11,7 @@ include("../utils/dummy_types.jl") return -log(M, q, p) / max(10 * eps(Float64), distance(M, p, q)) end mso = ManifoldSubgradientObjective(f, ∂f) - @testset "Objetive Decorator passthrough" begin + @testset "Objective Decorator passthrough" begin ddo = DummyDecoratedObjective(mso) @test get_cost(M, mso, p) == get_cost(M, ddo, p) @test get_subgradient(M, mso, p) == get_subgradient(M, ddo, p) diff --git a/test/solvers/test_Levenberg_Marquardt.jl b/test/solvers/test_Levenberg_Marquardt.jl index 9170b0cd39..295393b854 100644 --- a/test/solvers/test_Levenberg_Marquardt.jl +++ b/test/solvers/test_Levenberg_Marquardt.jl @@ -149,7 +149,7 @@ end length(ts_r2) * 2; ) @test isapprox(M, p_star, p2; atol=p_atol) - # tsting inplace + # testing inplace p3 = copy(M, p0) LevenbergMarquardt!( M, diff --git a/test/solvers/test_Nelder_Mead.jl b/test/solvers/test_Nelder_Mead.jl index e007a5604f..8d2a901976 100644 --- a/test/solvers/test_Nelder_Mead.jl +++ b/test/solvers/test_Nelder_Mead.jl @@ -81,7 +81,7 @@ Random.seed!(29) q = NelderMead(M, f) @test isapprox(p_star, q; atol=1e-7) s = NelderMead(M, f; return_state=true) - q2 = get_solver_result(s)[] #here we have to floatify ouselves + q2 = get_solver_result(s)[] #here we have to floatify ourselves @test isapprox(M, p_star, q2; atol=1e-7) population = NelderMeadSimplex(M) q3 = NelderMead(M, f, population) diff --git a/test/solvers/test_adaptive_regularization_with_cubics.jl b/test/solvers/test_adaptive_regularization_with_cubics.jl index 3be02bf4cc..047d12e814 100644 --- a/test/solvers/test_adaptive_regularization_with_cubics.jl +++ b/test/solvers/test_adaptive_regularization_with_cubics.jl @@ -3,7 +3,7 @@ using LinearAlgebra: I, tr, Symmetric include("../utils/example_tasks.jl") -@testset "Adaptive Reguilarization with Cubics" begin +@testset "Adaptive Regularization with Cubics" begin Random.seed!(42) n = 8 k = 3 @@ -63,7 +63,7 @@ include("../utils/example_tasks.jl") #add a fake Lanczos push!(arcs3.sub_state.Lanczos_vectors, copy(M, p1, X1)) step_solver!(arcs3.sub_problem, arcs3.sub_state, 2) # to introduce a random new one - # test orthognality of the new 2 ones + # test orthogonality of the new 2 ones @test isapprox( inner( M, @@ -82,7 +82,7 @@ include("../utils/example_tasks.jl") push!(arcs4.sub_state.Lanczos_vectors, copy(M, p1, X1)) push!(arcs4.sub_state.Lanczos_vectors, copy(M, p1, X1)) step_solver!(arcs4.sub_problem, arcs4.sub_state, 2) # to introduce a random new one but cupy to 2 - # test orthognality of the new 2 ones + # test orthogonality of the new 2 ones @test isapprox( inner( M, diff --git a/test/solvers/test_alternating_gradient.jl b/test/solvers/test_alternating_gradient.jl index 2fea35e8a5..f7e235e731 100644 --- a/test/solvers/test_alternating_gradient.jl +++ b/test/solvers/test_alternating_gradient.jl @@ -1,6 +1,6 @@ using Manopt, Manifolds, Test @testset "Alternating Gradient Descent" begin - # Note that this is mereely an alternating gradient descent toy example + # Note that this is merely an alternating gradient descent toy example M = Sphere(2) N = M × M data = [[1.0, 0.0, 0.0], [0.0, 1.0, 0.0]] diff --git a/test/solvers/test_cyclic_proximal_point.jl b/test/solvers/test_cyclic_proximal_point.jl index ae03a60364..08a9351971 100644 --- a/test/solvers/test_cyclic_proximal_point.jl +++ b/test/solvers/test_cyclic_proximal_point.jl @@ -111,7 +111,7 @@ using Manifolds, Manopt, Test, Dates, LRUCache @test isapprox(N, r, get_proximal_map(dmp2, 1.0, q, i)) end end - @testset "State accsess functions" begin + @testset "State access functions" begin M = Euclidean(3) p = ones(3) O = CyclicProximalPointState(M, zeros(3)) diff --git a/test/solvers/test_difference_of_convex.jl b/test/solvers/test_difference_of_convex.jl index af30940152..145c19f9f8 100644 --- a/test/solvers/test_difference_of_convex.jl +++ b/test/solvers/test_difference_of_convex.jl @@ -154,7 +154,7 @@ import Manifolds: inner @test isapprox(M, p4, p5) @test isapprox(M, p5, p6) @test isapprox(f(M, p5b), 0.0; atol=2e-16) # bit might be a different min due to rand - @test isapprox(f(M, p5c), 0.0; atol=1e-9) # might be a bit inprecise + @test isapprox(f(M, p5c), 0.0; atol=1e-9) # might be a bit imprecise @test isapprox(f(M, p4), 0.0; atol=2e-16) Random.seed!(23) @@ -165,7 +165,7 @@ import Manifolds: inner difference_of_convex_algorithm!(M, f, g, grad_h, p8; grad_g=grad_g) @test isapprox(M, p8, p2) - # using GD - only very inprecise + # using GD - only very imprecise p9 = difference_of_convex_algorithm( M, f, g, grad_h, p0; grad_g=grad_g, sub_hess=nothing ) diff --git a/test/solvers/test_gradient_descent.jl b/test/solvers/test_gradient_descent.jl index cf3049d560..fe899f8a07 100644 --- a/test/solvers/test_gradient_descent.jl +++ b/test/solvers/test_gradient_descent.jl @@ -162,7 +162,7 @@ using Manopt, Manifolds, Test, Random M = Sphere(2) q = 1 / sqrt(2) .* [1.0, 1.0, 0.0] f(M, p) = distance(M, p, q) .^ 2 - # chosse a wrong gradient such that ConstantStepsize yields an increase + # choose a wrong gradient such that ConstantStepsize yields an increase grad_f(M, p) = -grad_distance(M, q, p) # issues three warnings @test_logs (:warn,) (:warn,) (:warn,) gradient_descent( diff --git a/test/solvers/test_particle_swarm.jl b/test/solvers/test_particle_swarm.jl index 974562d792..94158f89d0 100644 --- a/test/solvers/test_particle_swarm.jl +++ b/test/solvers/test_particle_swarm.jl @@ -3,7 +3,7 @@ using Random @testset "Particle Swarm" begin # Test the particle swarm algorithm A = [1.0 3.0 4.0; 3.0 -2.0 -6.0; 4.0 -6.0 5.0] - @testset "Eucliedean Particle Swarm" begin + @testset "Euclidean Particle Swarm" begin M = Euclidean(3) f(::Euclidean, p) = (p' * A * p) / (p' * p) p1 = [[1.0, 2.0, 3.0], [4.0, 5.0, 6.0], [7.0, 8.0, 9.0]] diff --git a/test/solvers/test_primal_dual_semismooth_Newton.jl b/test/solvers/test_primal_dual_semismooth_Newton.jl index 4c4dc3bc02..1df5b6b8c1 100644 --- a/test/solvers/test_primal_dual_semismooth_Newton.jl +++ b/test/solvers/test_primal_dual_semismooth_Newton.jl @@ -188,7 +188,7 @@ using Manopt, Manifolds, ManifoldsBase, Test ) y2 = o2 @test x_hat ≈ y2 atol = 2 * 1e-7 - @testset "Objetive Decorator passthrough" begin + @testset "Objective Decorator passthrough" begin # PDNSSN additionals pdmsno = PrimalDualManifoldSemismoothNewtonObjective( f, prox_f, Dprox_F, prox_g_dual, Dprox_G_dual, DΛ, adjoint_DΛ; diff --git a/test/solvers/test_quasi_Newton.jl b/test/solvers/test_quasi_Newton.jl index 652f59e2d0..a949a6fd72 100644 --- a/test/solvers/test_quasi_Newton.jl +++ b/test/solvers/test_quasi_Newton.jl @@ -110,7 +110,7 @@ using LinearAlgebra: I, eigvecs, tr, Diagonal end end - @testset "Rayleigh Quotient Minimzation" begin + @testset "Rayleigh Quotient Minimization" begin n = 4 rayleigh_atol = 1e-7 A = [2.0 1.0 0.0 3.0; 1.0 3.0 4.0 5.0; 0.0 4.0 3.0 2.0; 3.0 5.0 2.0 6.0] @@ -332,7 +332,7 @@ using LinearAlgebra: I, eigvecs, tr, Diagonal push!(qns.direction_update.memory_y, copy(p)) push!(qns.direction_update.memory_y, copy(p)) qns.direction_update(mp, qns) - # Update (1) says at i=1 inner prodcucts are zero (2) all are zero -> gradient proposal + # Update (1) says at i=1 inner products are zero (2) all are zero -> gradient proposal @test contains(qns.direction_update.message, "i=1,2") @test contains(qns.direction_update.message, "gradient") end diff --git a/test/solvers/test_stochastic_gradient_descent.jl b/test/solvers/test_stochastic_gradient_descent.jl index e52b292def..51ccb7465b 100644 --- a/test/solvers/test_stochastic_gradient_descent.jl +++ b/test/solvers/test_stochastic_gradient_descent.jl @@ -131,7 +131,7 @@ using Manopt, Manifolds, Test q2 = copy(M, p) stochastic_gradient_descent!(M, msgo2, q2) end - @testset "Circle ecample" begin + @testset "Circle example" begin Mc = Circle() pc = 0.0 data = [-π / 4, 0.0, π / 4] diff --git a/test/solvers/test_subgradient_method.jl b/test/solvers/test_subgradient_method.jl index 98e1ed9387..392335b959 100644 --- a/test/solvers/test_subgradient_method.jl +++ b/test/solvers/test_subgradient_method.jl @@ -102,7 +102,7 @@ include("../utils/example_tasks.jl") Random.seed!(23) q4 = subgradient_method(M, f, ∂f!; evaluation=InplaceEvaluation()) @test isapprox(M, q4, p; atol=0.5) # random point -> not that close - # Check Fallbacks of Problen + # Check Fallbacks of Problem @test get_cost(mp, q1) == 0.0 @test norm(M, q1, get_subgradient(mp, q1)) == 0 @test_throws MethodError get_gradient(mp, sgs.p) diff --git a/test/solvers/test_trust_regions.jl b/test/solvers/test_trust_regions.jl index da3caef9b9..66e6c4e873 100644 --- a/test/solvers/test_trust_regions.jl +++ b/test/solvers/test_trust_regions.jl @@ -379,7 +379,7 @@ include("../utils/example_tasks.jl") Hess_f(M, p, X) = A * X - (p' * A * X) .* p - (p' * A * p) .* X q3 = trust_regions(M, f, grad_f, p0) q4 = trust_regions(M, f, grad_f, Hess_f, p0) - @test λ ≈ f(M, q3) atol = 2e-1 # Riemannian Hessian a bit inprecise? + @test λ ≈ f(M, q3) atol = 2e-1 # Riemannian Hessian a bit imprecise? @test λ ≈ f(M, q4) end end