Gradient Sampling Algorithm

Manopt.gradient_samplingFunction
gradient_sampling(M, f, grad_f, p=rand(M); kwargs...)
gradient_sampling(M, gradient_objective, p=rand(M); kwargs...)
gradient_sampling!(M, f, grad_f, p; kwargs...)
gradient_sampling!(M, gradient_objective, p; kwargs...)

perform the gradient sampling algorithm as introduced in [HU17].

The algorithm samples a set of sampling_size =$m$ many points in a ball around the current iterate, evaluates the gradient at these points and transports these to the current iterate. It then builds a surrogate in the tangent space consisting of these $m$ tangent vectors and the gradient at the current iterate to determine a new descent direction in the convex hull of these. See gradient_sampling_subsolver for the actual sub problem that is solved. If this direction exceeds, the subgradient_norm_tolerance the step is rejected and both the ball radius and this tolerance are reduced.

Input

  • M::AbstractManifold: a Riemannian manifold $\mathcal{M}$
  • f: a cost function $f: \mathcal{M}→ ℝ$ implemented as (M, p) -> v
  • grad_f: the (Riemannian) gradient $\operatorname{grad}f: \mathcal{M} → T_{p}\mathcal{M}$ of f as a function (M, p) -> X or a function (M, X, p) -> X computing X in-place
  • p::P: a point on the manifold $\mathcal{M}$

Alternatively to f and grad_f you can provide the corresponding AbstractManifoldFirstOrderObjective gradient_objective directly.

Keyword arguments

source
Manopt.gradient_sampling!Function
gradient_sampling(M, f, grad_f, p=rand(M); kwargs...)
gradient_sampling(M, gradient_objective, p=rand(M); kwargs...)
gradient_sampling!(M, f, grad_f, p; kwargs...)
gradient_sampling!(M, gradient_objective, p; kwargs...)

perform the gradient sampling algorithm as introduced in [HU17].

The algorithm samples a set of sampling_size =$m$ many points in a ball around the current iterate, evaluates the gradient at these points and transports these to the current iterate. It then builds a surrogate in the tangent space consisting of these $m$ tangent vectors and the gradient at the current iterate to determine a new descent direction in the convex hull of these. See gradient_sampling_subsolver for the actual sub problem that is solved. If this direction exceeds, the subgradient_norm_tolerance the step is rejected and both the ball radius and this tolerance are reduced.

Input

  • M::AbstractManifold: a Riemannian manifold $\mathcal{M}$
  • f: a cost function $f: \mathcal{M}→ ℝ$ implemented as (M, p) -> v
  • grad_f: the (Riemannian) gradient $\operatorname{grad}f: \mathcal{M} → T_{p}\mathcal{M}$ of f as a function (M, p) -> X or a function (M, X, p) -> X computing X in-place
  • p::P: a point on the manifold $\mathcal{M}$

Alternatively to f and grad_f you can provide the corresponding AbstractManifoldFirstOrderObjective gradient_objective directly.

Keyword arguments

source

State

Manopt.GradientSamplingStateType
GradientSamplingState

A state for the gradient sampling algorithm. The mathematical symbols are adapted from [HU17]

Fields

  • convex_hull_coefficients<:AbstractVector{R} store the solution vector of the sub problem, i.e. the coefficients of the result in the convex hull
  • p::P: a point on the manifold $\mathcal{M}$ storing the current iterate
  • sampled_points<:AbstractVector{P} memory to store the vector of sampled points
  • sampled_vectors<:AbstractVector{T} memory to store the vector of (transported) gradients
  • sampling_radius radius $ϵ_k$ of the ball around the iterate to sample from
  • sampling_radius_reduction factor $θ_ϵ$ to reduce the sampling radius when rejecting a step
  • subgradient_norm_reduction factor $θ_δ$ to reduce the subgradient norm tolerance when rejecting a step
  • subgradient_norm_tolerance bound $δ_k$ to reject too small gradient vector solutions from the sub problem
  • stop::StoppingCriterion: a functor indicating that the stopping criterion is fulfilled
  • stepsize::Stepsize: a functor inheriting from Stepsize to determine a step size
  • sub_problem::Union{AbstractManoptProblem, F}: specify a problem for a solver or a closed form solution function, which can be allocating or in-place.
  • sub_state::Union{AbstractManoptProblem, F}: a state to specify the sub solver to use. For a closed form solution, this indicates the type of function.
  • retraction_method::AbstractRetractionMethod: a retraction $\operatorname{retr}$ to use, see the section on retractions
  • vector_transport_method::AbstractVectorTransportMethod: a vector transport $\mathcal T_{⋅←⋅}$ to use, see the section on vector transports
  • X::T: a tangent vector at the point $p$ on the manifold $\mathcal{M}$ storing the gradient at the current iterate
  • Y::T: a tangent vector at the point $p$ on the manifold $\mathcal{M}$ a tangent vector to assemble the solution in.

Constructor

GradientSamplingState(
    M::AbstractManifold, sub_problem = gradient_sampling_subsolver!, sub_state = InplaceEvaluation(); kwargs...
)

Create a gradient sampling solver state

Input

  • M::AbstractManifold: a Riemannian manifold $\mathcal{M}$
  • sub_problem::Union{AbstractManoptProblem, F}: specify a problem for a solver or a closed form solution function, which can be allocating or in-place.
  • sub_state::Union{AbstractManoptProblem, F}: a state to specify the sub solver to use. For a closed form solution, this indicates the type of function.

Keyword arguments

source

Helpers and internal functions

Manopt.gradient_sampling_subsolverFunction
λ = gradient_sampling_subsolver(M, p, sampled_gradients)
gradient_sampling_subsolver!(M, λ, p, sampled_gradients)

solver for the subproblem of the gradient_sampling algorithm.

Let $Y_j$, $j=0,…m$ denote the sampled_gradients already provided transported to the tangent space at p

The subproblem then reads

\[\begin{align*} \operatorname*{arg\,min}_{λ ∈ ℝ^{m+1}} & \Bigr\lVert \sum_{j = 0}^{m} λ_j Y_{j}\Bigr\rVert^2 \\ \text{s. t.} \quad & \sum_{j = 0}^{m} λ_j = 1, \quad λ_j ≥ 0 \quad \text{for all } j =0,…,m. \end{align*}\]

Tip

A default subsolver based on RipQP.jl and QuadraticModels is available if these two packages are loaded.

source

Technical details

The gradient_sampling solver requires the following functions of a manifold to be available

  • A retract!(M, q, p, X); it is recommended to set the default_retraction_method to a favourite retraction. If this default is set, a retraction_method= does not have to be specified.
  • By default gradient sampling uses ArmijoLinesearch which requires max_stepsize(M) to be set and an implementation of inner(M, p, X).
  • By default the stopping criterion uses the norm as well, to stop when the norm of the gradient is small, but if you implemented inner(M, p, X), the norm is provided already.
  • By default the tangent vector storing the gradient is initialized calling zero_vector(M,p).
  • A vector_transport_to!M, Y, p, X, q); it is recommended to set the default_vector_transport_method to a favourite retraction. If this default is set, a vector_transport_method= does not have to be specified.

Literature

[HU17]
S. Hosseini and A. Uschmajew. A Riemannian Gradient Sampling Algorithm for Nonsmooth Optimization on Manifolds. SIAM Journal on Optimization 27, 173–189 (2017).