Alternating gradient descent
Manopt.alternating_gradient_descent — Function
alternating_gradient_descent(M::ProductManifold, f, grad_f, p=rand(M))
alternating_gradient_descent(M::ProductManifold, ago::ManifoldAlternatingGradientObjective, p)
alternating_gradient_descent!(M::ProductManifold, f, grad_f, p)
alternating_gradient_descent!(M::ProductManifold, ago::ManifoldAlternatingGradientObjective, p)perform an alternating gradient descent. This can be done in-place of the start point p.
Input
M::AbstractManifold: a Riemannian manifold $\mathcal{M}$f: a cost function $f: \mathcal{M}→ ℝ$ implemented as(M, p) -> vgrad_f: a gradient, that can be of two cases- is a single function returning an
ArrayPartitionfromRecursiveArrayTools.jlor - is a vector of functions, each returning a component part of the whole gradient
- is a single function returning an
p::P: a point on the manifold $\mathcal{M}$
Keyword arguments
callbacks::D = Dict{Symbol,Function}(): provided callback functions given either as a single function(symbol, problem, state, k)called in every hook or as a (vector of) pairs:hook => function, which are processed byprocess_callbacks_arg. As key you can either pass single symbol or an array of symbols to indicate a callback should be added in multiple placesevaluation::AbstractEvaluationType=AllocatingEvaluation(): specify whether the functions that return an array, for example a point or a tangent vector, work by allocating their 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.order_type=:Linear: whether to use a randomly permuted sequence (:FixedRandom), a per cycle newly permuted sequence (:Random) or the default:Linearevaluation order.inner_iterations=5: how many gradient steps to take in a component before alternating to the nextstopping_criterion::StoppingCriterion=StopAfterIteration(100)|StopWhenGradientNormLess(1.0e-9): a functor indicating that the stopping criterion is fulfilledstepsize::Stepsize=default_stepsize(M,AlternatingGradientDescentState; retraction_method=retraction_method): a functor inheriting fromStepsizeto determine a step sizeorder=collect(1:n): the initial permutation, wherenis the number of gradients ingrad_f.retraction_method::AbstractRetractionMethod=default_retraction_method(M, typeof(p)): a retraction $\operatorname{retr}$ to use, see the section on retractions
Output
usually the obtained (approximate) minimizer, see get_solver_return for details
Manopt.alternating_gradient_descent! — Function
alternating_gradient_descent(M::ProductManifold, f, grad_f, p=rand(M))
alternating_gradient_descent(M::ProductManifold, ago::ManifoldAlternatingGradientObjective, p)
alternating_gradient_descent!(M::ProductManifold, f, grad_f, p)
alternating_gradient_descent!(M::ProductManifold, ago::ManifoldAlternatingGradientObjective, p)perform an alternating gradient descent. This can be done in-place of the start point p.
Input
M::AbstractManifold: a Riemannian manifold $\mathcal{M}$f: a cost function $f: \mathcal{M}→ ℝ$ implemented as(M, p) -> vgrad_f: a gradient, that can be of two cases- is a single function returning an
ArrayPartitionfromRecursiveArrayTools.jlor - is a vector of functions, each returning a component part of the whole gradient
- is a single function returning an
p::P: a point on the manifold $\mathcal{M}$
Keyword arguments
callbacks::D = Dict{Symbol,Function}(): provided callback functions given either as a single function(symbol, problem, state, k)called in every hook or as a (vector of) pairs:hook => function, which are processed byprocess_callbacks_arg. As key you can either pass single symbol or an array of symbols to indicate a callback should be added in multiple placesevaluation::AbstractEvaluationType=AllocatingEvaluation(): specify whether the functions that return an array, for example a point or a tangent vector, work by allocating their 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.order_type=:Linear: whether to use a randomly permuted sequence (:FixedRandom), a per cycle newly permuted sequence (:Random) or the default:Linearevaluation order.inner_iterations=5: how many gradient steps to take in a component before alternating to the nextstopping_criterion::StoppingCriterion=StopAfterIteration(100)|StopWhenGradientNormLess(1.0e-9): a functor indicating that the stopping criterion is fulfilledstepsize::Stepsize=default_stepsize(M,AlternatingGradientDescentState; retraction_method=retraction_method): a functor inheriting fromStepsizeto determine a step sizeorder=collect(1:n): the initial permutation, wherenis the number of gradients ingrad_f.retraction_method::AbstractRetractionMethod=default_retraction_method(M, typeof(p)): a retraction $\operatorname{retr}$ to use, see the section on retractions
Output
usually the obtained (approximate) minimizer, see get_solver_return for details
State
Manopt.AlternatingGradientDescentState — Type
AlternatingGradientDescentState <: AbstractGradientSolverStateStore the fields for an alternating gradient descent algorithm, see also alternating_gradient_descent.
Fields
callbacks::D: provided callback functions given as a dictionary with symbols as keysdirection::DirectionUpdateRuleorder_type::Symbol: whether to use a randomly permuted sequence (:FixedRandom), a per cycle newly permuted sequence (:Random) or the default:Linearevaluation order.inner_iterations: how many gradient steps to take in a component before alternating to the nextorder: the current permutationretraction_method::AbstractRetractionMethod: a retraction $\operatorname{retr}$ to use, see the section on retractionsstepsize::Stepsize: a functor inheriting fromStepsizeto determine a step sizestop::StoppingCriterion: a functor indicating that the stopping criterion is fulfilledp::P: a point on the manifold $\mathcal{M}$ storing the current iterateX::T: a tangent vector at the point $p$ on the manifold $\mathcal{M}$ storing the gradient at the current iteratek,i: internal counters for the current component of theorderand the inner iterations within that component, respectively.
Constructors
AlternatingGradientDescentState(M::AbstractManifold; kwargs...)Keyword arguments
inner_iterations=5p::P =rand(M): a point on the manifold $\mathcal{M}$callbacks::D = Dict{Symbol,Function}(): provided callback functions given as a dictionary with symbols as keysorder_type::Symbol=:Linearorder::Vector{<:Int}=Int[]stopping_criterion::StoppingCriterion=StopAfterIteration(1000): a functor indicating that the stopping criterion is fulfilledretraction_method::AbstractRetractionMethod=default_retraction_method(M, typeof(p)): a retraction $\operatorname{retr}$ to use, see the section on retractionsstepsize::Stepsize=default_stepsize(M, AlternatingGradientDescentState; retraction_method=retraction_method): a functor inheriting fromStepsizeto determine a step sizeX::T =zero_vector(M, p): a tangent vector at the point $p$ on the manifold $\mathcal{M}$
Generate the state for point p and where inner_iterations, order_type, order, retraction_method, stopping_criterion, and stepsize are keyword arguments.
For internal use, there also exists a constructor solely having the fields as keyword arguments, but then all of them are mandatory.
Additionally, the state shares a DirectionUpdateRule, which chooses the current component, so they can be decorated further; the innermost one should always be the following one though.
Manopt.AlternatingGradient — Function
AlternatingGradient(; kwargs...)
AlternatingGradient(M::AbstractManifold; kwargs...)Specify that a gradient based method should only update parts of the gradient in order to do an alternating gradient descent.
Keyword arguments
X::T =zero_vector(M, p): a tangent vector at the point $p$ on the manifold $\mathcal{M}$p::P =rand(M): a point on the manifold $\mathcal{M}$ to specify the initial value
This function generates a ManifoldDefaultsFactory for AlternatingGradientRule. For default values that depend on the manifold, this factory postpones the construction until the manifold is available, for example from a corresponding AbstractManoptSolverState.
Manopt.AlternatingGradientRule — Type
AlternatingGradientRule <: AbstractGradientGroupDirectionRuleThe direction processor to alternate the gradient directions.
Create a functor (problem, state, k) -> (s, X) to evaluate the alternating gradient, that is alternating between the components of the gradient and has a field for partial evaluation of the gradient in-place.
Fields
X::T: a tangent vector at the point $p$ on the manifold $\mathcal{M}$
Constructor
AlternatingGradientRule(M::AbstractManifold; p=rand(M), X=zero_vector(M, p))Initialize the alternating gradient processor with tangent vector type of X, where both M and p are just help variables.
See also
Technical details
The alternating_gradient_descent solver requires the following functions of a manifold to be available
using RecursiveArrayTools, since the solver is provided by an extension.- The problem has to be phrased on a
ProductManifold, to be able to alternate between parts of the input. - A
retract!(M, q, p, X); it is recommended to set thedefault_retraction_methodto a favorite retraction. If this default is set, aretraction_method=does not have to be specified. - By default alternating gradient descent uses
ArmijoLinesearchwhich requiresmax_stepsize(M)to be set and an implementation ofinner(M, p, X, Y). - By default the tangent vector storing the gradient is initialized calling
zero_vector(M,p).