Projected gradient method
Manopt.projected_gradient_method — Function
projected_gradient_method(M, f, grad_f, proj, p=rand(M); kwargs...)
projected_gradient_method(M, obj::ManifoldConstrainedSetObjective, p=rand(M); kwargs...)
projected_gradient_method!(M, f, grad_f, proj, p; kwargs...)
projected_gradient_method!(M, obj::ManifoldConstrainedSetObjective, p; kwargs...)Compute the projected gradient method for the constrained problem
\[\begin{aligned} \operatorname*{arg\,min}_{p ∈ \mathcal{M}} & f(p)\\ \text{subject to}\quad& p ∈ \mathcal{C} ⊂ \mathcal{M} \end{aligned}\]
by performing the following steps
- Using the
stepsize$α_k$ compute a candidate $q_k = \operatorname{proj}_{\mathcal{C}}\Bigl(\operatorname{retr}_{p_k}\bigl(-α_k \operatorname{grad} f(p_k)\bigr)\Bigr)$ - Compute a backtracking stepsize $β_k ≤ 1$ along $Y_k = \operatorname{retr}_{p_k}^{-1}q_k$
- Compute the new iterate $p_{k+1} = \operatorname{retr}_{p_k}( β_k \operatorname{retr}_{p_k}^{-1}q_k )$
until the stopping_criterion= is fulfilled.
For more information see [BFNZ25].
Input
M::AbstractManifold: a Riemannian manifold $\mathcal{M}$f: a cost function $f: \mathcal{M}→ ℝ$ implemented as(M, p) -> vgrad_f: the (Riemannian) gradient $\operatorname{grad}f: \mathcal{M} → T_{p}\mathcal{M}$ of f as a function(M, p) -> Xor a function(M, X, p) -> XcomputingXin-placeprojthe function that projects onto the set $\mathcal{C}$ as a function(M, p) -> qor a function(M, q, p) -> qcomputing the projection in-place ofq.p::P: a point on the manifold $\mathcal{M}$
Keyword arguments
callbacks::D = Dict{Symbol,Function}(): provided callback functions$A single function `(symbol, problem, state, k)` called in every hook, a (vector of) pairs `:hook => function` will be processed by [$ ,YOu can either pass an array of Pairsassumed to be stored in a dictionary like structure with symbols as keysbacktrack::Stepsize=ArmijoLinesearchStepsize(M; stop_increasing_at_step=0): a functor inheriting fromStepsizeto determine a step size to perform the backtracking to determine the $β_k$. Note that the method requires $β_k ≤ 1$, otherwise the projection step no longer provides points within the constraintsevaluation::AbstractEvaluationType=AllocatingEvaluation(): specify whether the functions that return an array, for example a point or a tangent vector, work by allocating its result (AllocatingEvaluation) or whether they modify their input argument to return the result therein (InplaceEvaluation). Since usually the first argument is the manifold, the modified argument is the second.retraction_method::AbstractRetractionMethod=default_retraction_method(M, typeof(p)): a retraction $\operatorname{retr}$ to use, see the section on retractionsstepsize::Stepsize=ConstantStepsize(injectivity_radius(M)/2): a functor inheriting fromStepsizeto determine a step size to perform the candidate projected step.stopping_criterion::StoppingCriterion=StopAfterIteration(500)|StopWhenGradientNormLess(1.0e-6): a functor indicating that the stopping criterion is fulfilled
All other keyword arguments are passed to decorate_state! for state decorators or decorate_objective! for objective decorators, respectively.
Output
The obtained approximate minimizer $p^*$. To obtain the whole final state of the solver, see get_solver_return for details, especially the return_state= keyword.
Manopt.projected_gradient_method! — Function
projected_gradient_method(M, f, grad_f, proj, p=rand(M); kwargs...)
projected_gradient_method(M, obj::ManifoldConstrainedSetObjective, p=rand(M); kwargs...)
projected_gradient_method!(M, f, grad_f, proj, p; kwargs...)
projected_gradient_method!(M, obj::ManifoldConstrainedSetObjective, p; kwargs...)Compute the projected gradient method for the constrained problem
\[\begin{aligned} \operatorname*{arg\,min}_{p ∈ \mathcal{M}} & f(p)\\ \text{subject to}\quad& p ∈ \mathcal{C} ⊂ \mathcal{M} \end{aligned}\]
by performing the following steps
- Using the
stepsize$α_k$ compute a candidate $q_k = \operatorname{proj}_{\mathcal{C}}\Bigl(\operatorname{retr}_{p_k}\bigl(-α_k \operatorname{grad} f(p_k)\bigr)\Bigr)$ - Compute a backtracking stepsize $β_k ≤ 1$ along $Y_k = \operatorname{retr}_{p_k}^{-1}q_k$
- Compute the new iterate $p_{k+1} = \operatorname{retr}_{p_k}( β_k \operatorname{retr}_{p_k}^{-1}q_k )$
until the stopping_criterion= is fulfilled.
For more information see [BFNZ25].
Input
M::AbstractManifold: a Riemannian manifold $\mathcal{M}$f: a cost function $f: \mathcal{M}→ ℝ$ implemented as(M, p) -> vgrad_f: the (Riemannian) gradient $\operatorname{grad}f: \mathcal{M} → T_{p}\mathcal{M}$ of f as a function(M, p) -> Xor a function(M, X, p) -> XcomputingXin-placeprojthe function that projects onto the set $\mathcal{C}$ as a function(M, p) -> qor a function(M, q, p) -> qcomputing the projection in-place ofq.p::P: a point on the manifold $\mathcal{M}$
Keyword arguments
callbacks::D = Dict{Symbol,Function}(): provided callback functions$A single function `(symbol, problem, state, k)` called in every hook, a (vector of) pairs `:hook => function` will be processed by [$ ,YOu can either pass an array of Pairsassumed to be stored in a dictionary like structure with symbols as keysbacktrack::Stepsize=ArmijoLinesearchStepsize(M; stop_increasing_at_step=0): a functor inheriting fromStepsizeto determine a step size to perform the backtracking to determine the $β_k$. Note that the method requires $β_k ≤ 1$, otherwise the projection step no longer provides points within the constraintsevaluation::AbstractEvaluationType=AllocatingEvaluation(): specify whether the functions that return an array, for example a point or a tangent vector, work by allocating its result (AllocatingEvaluation) or whether they modify their input argument to return the result therein (InplaceEvaluation). Since usually the first argument is the manifold, the modified argument is the second.retraction_method::AbstractRetractionMethod=default_retraction_method(M, typeof(p)): a retraction $\operatorname{retr}$ to use, see the section on retractionsstepsize::Stepsize=ConstantStepsize(injectivity_radius(M)/2): a functor inheriting fromStepsizeto determine a step size to perform the candidate projected step.stopping_criterion::StoppingCriterion=StopAfterIteration(500)|StopWhenGradientNormLess(1.0e-6): a functor indicating that the stopping criterion is fulfilled
All other keyword arguments are passed to decorate_state! for state decorators or decorate_objective! for objective decorators, respectively.
Output
The obtained approximate minimizer $p^*$. To obtain the whole final state of the solver, see get_solver_return for details, especially the return_state= keyword.
State
Manopt.ProjectedGradientMethodState — Type
ProjectedGradientMethodState <: AbstractManoptSolverStateFields
backtracking::Stepsize: a functor inheriting fromStepsizeto determine a step size to determine the step size $β_k$ step size from $p_k$ to the candidate $q_k$callbacks::D: provided callback functions`` provided as a dictionary symbols as keysinverse_retraction_method::AbstractInverseRetractionMethod: an inverse retraction $\operatorname{retr}^{-1}$ to use, see the section on retractions and their inversesp::P: a point on the manifold $\mathcal{M}$ storing the current iterateq::P: a point on the manifold $\mathcal{M}$ an interims point for the projected gradient stepretraction_method::AbstractRetractionMethod: a retraction $\operatorname{retr}$ to use, see the section on retractionsstepsize::Stepsize: a functor inheriting fromStepsizeto determine a step size $α_k$ to determine the $q_k$ candidatestop::StoppingCriterion: a functor indicating that the stopping criterion is fulfilledX::T: a tangent vector at the point $p$ on the manifold $\mathcal{M}$Y::T: a tangent vector at the point $p$ on the manifold $\mathcal{M}$ a temporary memory for a tangent vector to store the no. Used within the backtracking
Constructor
ProjectedGradientMethodState(M, p=rand(M); kwargs...)Keyword arguments
callbacks::D = Dict{Symbol,Function}(): provided callback functions`` provided as a dictionary symbols as keysbacktracking::Stepsize=ArmijoLinesearchStepsize(M): a functor inheriting fromStepsizeto determine a step size $p_k$ to the candidate $q_k$inverse_retraction_method::AbstractInverseRetractionMethod=default_inverse_retraction_method(M, typeof(p)): an inverse retraction $\operatorname{retr}^{-1}$ to use, see the section on retractions and their inversesretraction_method::AbstractRetractionMethod=default_retraction_method(M, typeof(p)): a retraction $\operatorname{retr}$ to use, see the section on retractionsstepsize::Stepsize=ConstantStepsize(M): a functor inheriting fromStepsizeto determine a step size $α_k$ to determine the $q_k$ candidatestop::StoppingCriterion=StopAfterIteration(300): a functor indicating that the stopping criterion is fulfilledX::T =zero_vector(M, p): a tangent vector at the point $p$ on the manifold $\mathcal{M}$
Stopping criteria
Manopt.StopWhenProjectedGradientStationary — Type
StopWhenProjectedGradientStationary <: StoppingCriterionStop when the step taken by the projection is (before linesearch) exactly the opposite of the
Literature
- [BFNZ25]
- R. Bergmann, O. P. Ferreira, S. Z. Németh and J. Zhu. On projection mappings and the gradient projection method on hyperbolic space forms. Preprint, in preparation (2025).