Objectives
Manopt.ConstrainedManifoldObjective β Type
ConstrainedManifoldObjective{C<:ConstraintType} <: AbstractManifoldObjectiveDescribes a constrained objective
\[\begin{aligned} \operatorname*{arg\,min}_{p β \mathcal{M}} & f(p)\\ \text{subject to}\quad&g_i(p) β€ 0 \quad \text{ for } i= 1, β¦, m,\\ \quad & h_j(p)=0 \quad \text{ for } j=1,β¦,n, \end{aligned}\]
Fields
objective: anAbstractManifoldObjectiverepresenting the unconstrained objective, that is containing cost $f$, the gradient of the cost $f$ and maybe the Hessian.equality_constraints: anAbstractManifoldObjectiverepresenting the equality constraints $h: \mathcal{M} β β^n$ also possibly containing its gradient and/or Hessianinequality_constraints: anAbstractManifoldObjectiverepresenting the inequality constraints $g: \mathcal{M} β β^m$ also possibly containing its gradient and/or Hessian
Constructors
ConstrainedManifoldObjective(f, grad_f; equality_constraints=nothing, inequality_constraints=nothing, g=missing, grad_g=missing, h=missing, grad_h=missing, hess_f=missing, hess_g=missing, hess_h=missing, evaluation=AllocatingEvaluation(), M = missing, p = ismissing(M) ? missing : rand(M), atol = 0,)Generate the constrained objective based on all involved single functions f, grad_f, g, grad_g, h, grad_h, and optionally a Hessian for each of these. With equality_constraints and inequality_constraints you have to provide the dimension of the ranges of h and g, respectively. You can also provide a manifold M and a point p to use one evaluation of the constraints to automatically try to determine these sizes.
ConstrainedManifoldObjective(mho::AbstractManifoldObjective; equality_constraints = nothing, inequality_constraints = nothing)Generate the constrained objective either with explicit constraints $g$ and $h$, and their gradients, or in the form where these are already encapsulated in VectorGradientFunctions.
Both variants require that at least one of the constraints (and its gradient) is provided. If any of the three parts provides a Hessian, the corresponding object, that is a ManifoldHessianObjective for f or a VectorHessianFunction for g or h, respectively, is created.
Feasibility of points with respect to the constraints is determined up to the tolerance atol.
Manopt.EmbeddedManifoldObjective β Type
EmbeddedManifoldObjective{P, T, O2, O1<:AbstractManifoldObjective} <:
AbstractDecoratedManifoldObjective{O2}Declare an objective to be defined in the embedding. This also declares the gradient to be defined in the embedding, and especially being the Riesz representer with respect to the metric in the embedding. The types can be used to still dispatch on also the undecorated objective type O2, in case the objective being stored here is decorated, e.g. with a cache.
Fields
objective: the objective that is defined in the embeddingp=missing: a point in the embedding.X=missing: a tangent vector in the embedding
When a point in the embedding p is provided, embed! is used in place of this point to reduce memory allocations. Similarly X is used when embedding tangent vectors.
Manopt.ManifoldAlternatingGradientObjective β Type
ManifoldAlternatingGradientObjective{F,G} <: AbstractManifoldFirstOrderObjective{F, G}An alternating gradient objective consists of
- a cost function $F(p)$
- a gradient $\operatorname{grad}F$ that is either
- given as one function $\operatorname{grad}F$ returning a tangent vector
XonMor - an array of gradient functions $\operatorname{grad}F_i$,
i=1,β¦,n, each returning a component of the gradient
- given as one function $\operatorname{grad}F$ returning a tangent vector
This Objective is usually defined using the ProductManifold from Manifolds.jl, so Manifolds.jl has to be loaded.
Constructors
ManifoldAlternatingGradientObjective(F, gradF::Function; evaluation=AllocatingEvaluation(), p = missing)ManifoldAlternatingGradientObjective(F, gradF::AbstractVector{<:Function}; evaluation=AllocatingEvaluation(), p = missing)Create an alternating gradient problem with an optional cost and the gradient either as one function (returning an array) or a vector of functions.
Keyword Arguments
evaluation::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.p = missingprovide a point to automatically ensure the functions of the objective βactβ on mutating variables.
Manopt.ManifoldCachedObjective β Type
ManifoldCachedObjective{P,O<:AbstractManifoldObjective,C<:NamedTuple{}} <: AbstractDecoratedManifoldObjective{P}Create a cache for an objective, based on a NamedTuple that stores some kind of cache.
Constructor
ManifoldCachedObjective(M, o::AbstractManifoldObjective, caches::Vector{Symbol}; kwargs...)Create a cache for the AbstractManifoldObjective where the Symbols in caches indicate, which function evaluations to cache.
Supported symbols
| Symbol | Caches calls to (incl. ! variants) | Comment |
|---|---|---|
:Cost | get_cost | |
:Differential | get_differential(M, p, X) | |
:EqualityConstraint | get_equality_constraint(M, p, i) | |
:EqualityConstraints | get_equality_constraint(M, p, :) | |
:GradEqualityConstraint | get_grad_equality_constraint | tangent vector per (p,i) |
:GradInequalityConstraint | get_grad_inequality_constraint | tangent vector per (p,i) |
:Gradient | get_gradient(M,p) | tangent vectors |
:Hessian | get_hessian | tangent vectors |
:InequalityConstraint | get_inequality_constraint(M, p, j) | |
:InequalityConstraints | get_inequality_constraint(M, p, :) | |
:Preconditioner | get_preconditioner | tangent vectors |
:ProximalMap | get_proximal_map | point per (p,Ξ»,i) |
:StochasticGradients | get_gradients | vector of tangent vectors |
:StochasticGradient | get_gradient(M, p, i) | tangent vector per (p,i) |
:SubGradient | get_subgradient | tangent vectors |
:SubtrahendGradient | get_subtrahend_gradient | tangent vectors |
Keyword arguments
p=rand(M): the type of the keys to be used in the caches. Defaults to the default representation onM.value=get_cost(M, objective, p): the type of values for numeric values in the cacheX=zero_vector(M,p): the type of values to be cached for gradient and Hessian calls.cache_size=10: number of (least recently used) calls to cachecache_sizes=Dict{Symbol,Int}(): a named tuple or dictionary specifying the sizes individually for each cache.
Manopt.ManifoldConstrainedSetObjective β Type
ManifoldConstrainedSetObjective{MO, PF, IF} <: AbstractManifoldObjectiveModel a constrained objective restricted to a set
\[\operatorname*{arg\,min}_{p β \mathcal{C}} f(p)\]
where $\mathcal{C} β \mathcal{M}$ is a convex closed subset.
Fields
objective::AbstractManifoldObjectivethe (unconstrained) objective, which contains $f$ and for example its gradient $\operatorname{grad} f$.project!::PFa projection function $\operatorname{proj}_{\mathcal{C}}: \mathcal{M} β \mathcal{C}$ that projects onto the set $\mathcal{C}$.indicator::IFthe indicator function $ΞΉ_{\mathcal{C}}(p) = \begin{cases} 0 &\text{ for }pβ\mathcal{C}\\\\ β &\text{ else.}\end{cases}$
Constructor
ManifoldConstrainedSetObjective(f, grad_f, project!; kwargs...)Generate the constrained objective for a given function f its gradient grad_f and a projection project! $\operatorname{proj}_{\mathcal{C}}$.
Keyword arguments
indicator=missing: the indicator function $ΞΉ_{\mathcal{C}}(p)$. If not provided, a test whether the projection yields the same point is performed. For theInplaceEvaluationthis requires one allocation.
Manopt.ManifoldCostGradientObjective β Method
ManifoldCostGradientObjective(costgrad; kwargs...)Create an objective containing one function to perform a combined computation of cost and its gradient
Internally this is stored in a ManifoldFirstOrderObjective. The kwargs... are also passed to this representation, which allows to add a special function to evaluate the differential.
Used with
Manopt.ManifoldCostObjective β Type
ManifoldCostObjective{F} <: AbstractManifoldCostObjective{F}Specify an AbstractManifoldObjective that does only have information about the cost function $f: \mathcal{M} β β$ implemented as a function (M, p) -> c to compute the cost value c at p on the manifold M.
Fields
cost: a function $f: \mathcal{M} β β$ to minimize
Constructors
ManifoldCostObjective(f; p::P = missing) where {P}ManifoldCostObjective(f, ::Type{P}) where {P}Generate a ManifoldCostObjective with cost function f.
Keyword Arguments
p = missingprovide a point to automatically ensure the functions of the objective βactβ on mutating variables.
See also
Manopt.ManifoldCountObjective β Type
ManifoldCountObjective{P,O<:AbstractManifoldObjective,I<:Union{<:Integer,AbstractVector{<:Integer}}} <: AbstractDecoratedManifoldObjective{P}A wrapper for any AbstractManifoldObjective of type O to count different calls to parts of the objective.
Fields
countsa dictionary of symbols mapping to integers keeping the counted valuesobjectivethe wrapped objective
Supported symbols
| Symbol | Counts calls to (incl. ! variants) | Comment |
|---|---|---|
:Cost | get_cost | |
:Differential | get_differential | |
:EqualityConstraint | get_equality_constraint | requires vector of counters |
:EqualityConstraints | get_equality_constraint | when evaluating all of them with : |
:GradEqualityConstraint | get_grad_equality_constraint | requires vector of counters |
:GradEqualityConstraints | get_grad_equality_constraint | when evaluating all of them with : |
:GradInequalityConstraint | get_grad_inequality_constraint | requires vector of counters |
:GradInequalityConstraints | get_grad_inequality_constraint | when evaluating all of them with : |
:Gradient | get_gradient(M,p) | |
:Hessian | get_hessian | |
:InequalityConstraint | get_inequality_constraint | requires vector of counters |
:InequalityConstraints | get_inequality_constraint | when evaluating all of them with : |
:Preconditioner | get_preconditioner | |
:ProximalMap | get_proximal_map | |
:StochasticGradients | get_gradients | |
:StochasticGradient | get_gradient(M, p, i) | |
:SubGradient | get_subgradient | |
:SubtrahendGradient | get_subtrahend_gradient |
Constructors
ManifoldCountObjective(objective::AbstractManifoldObjective, counts::Dict{Symbol, <:Integer})Initialize the ManifoldCountObjective to wrap objective, initializing the set of counts.
ManifoldCountObjective(M::AbstractManifold, objective::AbstractManifoldObjective, count::AbstractVector{Symbol}, init=0)Count function calls on objective using the symbols in count initializing all entries to init.
Manopt.ManifoldFirstOrderObjective β Type
ManifoldFirstOrderObjective{F<:NamedTuple} <: AbstractManifoldFirstOrderObjective{F, F}Specify an objective containing a cost and its gradient or differential.
Fields
functions::F: a function or a tuple of functions containing the cost and first order information.
Currently the following cases are covered, sorted by their popularity
- a single function
fgrepresenting a combined function(M, X, p) -> (c, X)that computes the costc=cost(M,p)and gradientX=grad_f(M, X, p); - a single function
fdfrepresenting a combined function(M, d, p) -> (c, d)that computes the costc=cost(M,p)and differentiald=diff_f(M, d, p); - pairs of single functions
(f, g),(f, df)of a cost functionfand either its gradientgor its differentiald, respectively - The function
(fg, d)and(fdf, g)from 1 and 2, respectively joined by the other missing third information, the differential for the first or the gradient for the second - a tuple
(f, g, d)of three functions, computing costf, gradientg, and differentialdseparately - a tuple
(f, gd)of a cost function and a combined function(X, d) = gd(M, (X,d), p)to compute gradient and differential together
In all cases a gradient and/or a differential that is present is assumed to work in-place, see the InplaceManifoldFunction wrapper for alternatives.
The cases of a common fg function for cost and gradient and the tuple (f,g) are the most common ones. They can also be addressed by their alternate constructors ManifoldCostGradientObjective(fg) and ManifoldGradientObjective(f,g), respectively.
Constructors
ManifoldFirstOrderObjective(; kwargs...)Keyword arguments
cost = missingthe cost functionc = f(M,p)costdifferential = missingthe combined cost and differential functionfdf(M, p, X)costgradient = missingthe combined cost and gradient functionfg(M,p)or in-placefg!(M, X, p)differential = missingthe differentiald = df(M, p, X)evaluation::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.gradient=missingthe gradient functiong(M, p)or in-placeg!(M, X, p)p = missingprovide a point to automatically ensure the functions of the objective βactβ on mutating variables.
Where:
- At least one of
cost,costgradientorcostdifferentialmust be provided. - Either
gradient,costgradient,differentialorcostdifferentialmust be provided. - If more than one function provides the same thing (e.g. cost), it is assumed that all such functions return the same value. Optimization algorithms will attempt to make the most efficient use of provided functions fitting for the access required.
Used with
Manopt.ManifoldGradientObjective β Method
ManifoldGradientObjective(cost, gradient; kwargs...)Generate an objective with a function cost and its gradient. The gradient is assumed to work in-place
- as a function
(M, X, p) -> Xthat works in place ofX, anInplaceEvaluation
Internally this is stored in a ManifoldFirstOrderObjective. The kwargs... are also passed to this representation, which allows to add a special function to evaluate the differential.
Used with
Manopt.ManifoldHessianObjective β Type
ManifoldHessianObjective{C,G,H,Pre} <: AbstractManifoldHessianObjective{C,G,H}Specify a problem for Hessian based algorithms.
Fields
cost: a function $f:\mathcal{M}ββ$ to minimizegradient: the gradient $\operatorname{grad}f:\mathcal{M} β T\mathcal{M}$ of the cost function $f$hessian: the Hessian $\operatorname{Hess}f(p)[β ]: T_{p}\mathcal{M} β T_{p}\mathcal{M}$ of the cost function $f$preconditioner: the symmetric, positive definite preconditioner as an approximation of the inverse of the Hessian of $f$, a map with the same input variables as thehessianto numerically stabilize iterations when the Hessian is ill-conditioned
Constructor
ManifoldHessianObjective( f, grad_f, Hess_f, preconditioner = missing; p = missing, evaluation=AllocatingEvaluation())Generate a ManifoldHessianObjective from a cost function f, its gradient grad_f, its Hessian Hess_f, and an optional preconditioner preconditioner. The evaluation keyword argument can be used to specify whether the functions are in-place or allocating, a point p can be used to specify the domain of the functions, which only has a βwrappingβ effect if p is an immutable number.
See also
Manopt.ManifoldNonlinearLeastSquaresObjective β Type
ManifoldNonlinearLeastSquaresObjective{VFV,RFV,TVC} <: AbstractManifoldFirstOrderObjective{VFV, VFV}An objective to model the robustified nonlinear least squares problem
\[\operatorname*{arg\,min}_{p β \mathcal{M}} f(p), \qquad f(p) = \frac{1}{2} \sum_{i=1}^{m} Ο_i \bigl( \lVert F_i(p) \rVert^2 \bigr)\]
where $F_i: \mathcal{M} β β^{n_i}$ is the $i$th block component of length $n_i > 0$ and each $Ο_i: β β β$ is a robustifier function, cf. AbstractRobustifierFunction, for each such a block component. The overall residual function is denoted by $F: \mathcal{M} β β^{n}$ with $n = \sum_{i=1}^{m} n_i$ and concatenates all block components.
Fields
objective: a vector ofAbstractFirstOrderVectorFunctions, one for each block component cost function $F_i$, which might internally also be a vector of component costs $(F_i)_j$, as well as their Jacobian $J_{F_i}$ or a vector of gradients $\operatorname{grad} (F_i)_j$ depending on the specifiedAbstractVectorialTypes.robustifier: a vector ofAbstractRobustifierFunctions, one for each block component cost function $F_i$.value_cache::AbstractVectoran internal cache to store the result of evaluating the cost functions
Constructors
ManifoldNonlinearLeastSquaresObjective(f, jacobian, range_dimension::Integer, robustifier=IdentityRobustifier(); kwargs...)Create a nonlinear least squares objective for a single vectorial function f and its jacobian, where range_dimension is the dimension of the vector space f maps into. These three are internally wrapped into a VectorGradientFunction and this then calls the following constructor.
ManifoldNonlinearLeastSquaresObjective(vf::AbstractFirstOrderVectorFunction, robustifier::AbstractRobustifierFunction=IdentityRobustifier())Create a nonlinear least squares objective for a given vectorial function. Note that for this constructor the robustifier is applied componentwise to each component of vf, i.e. wrapped in a ComponentwiseRobustifierFunction. Internally this wraps both vf and robustifier in an array and calls the next constructor. Hence to not use the componentwise robustifier but a global one, pass [vf,] and [robustifier,] instead.
ManifoldNonlinearLeastSquaresObjective(fs::Vector{<:AbstractFirstOrderVectorFunction}, robustifiers::Vector{<:AbstractRobustifierFunction}=fill(IdentityRobustifier(), length(fs)))Given a vector of AbstractFirstOrderVectorFunctions to represent the single blocks and a vector of robustifiers, one for each block, create the corresponding nonlinear least squares objective.
Keyword arguments
The first constructor, that is the variant for a single block, accepts the following keyword arguments, which are passed on to the corresponding VectorGradientFunction constructor.
function_type::AbstractVectorialType=FunctionVectorialType(): specify the format the residuals are given in. By default a function returning a vector.jacobian_tangent_basis::AbstractBasis=DefaultOrthonormalBasis(): shortcut to specify the basis the Jacobian matrix is build with.jacobian_type::AbstractVectorialType=CoefficientVectorialType(jacobian_tangent_basis): specify the format the Jacobian is given in. By default a matrix of the differential with respect to a certain basis of the tangent space.
See also
Manopt.ManifoldProximalGradientObjective β Type
ManifoldProximalGradientObjective{TC, TG, TGG, TP} <: AbstractManifoldCostObjective{TC}Model an objective of the form
\[f(p) = g(p) + h(p), \qquad p β \mathcal{M},\]
where $g: \mathcal{M} β \bar{\mathbb R}$ is a differentiable function and $h: \mathcal{M} β \bar{\mathbb R}$ is a (possibly) lower semicontinuous and proper function.
This objective provides the total cost $f$, its smooth component $g$, as well as $\operatorname{grad} g$ and $\operatorname{prox}_{Ξ» h}$.
Fields
cost: the overall cost $f = g + h$cost_smooth: the smooth cost component $g$gradient_g!: the gradient $\operatorname{grad} g$proximal_map_h!: the proximal map $\operatorname{prox}_{Ξ» h}$
Constructor
ManifoldProximalGradientObjective(f, g, grad_g, prox_h = missing)Generate the proximal gradient objective given the total cost $f = g + h$, smooth cost $g$, the gradient of the smooth component $\operatorname{grad} g$, and the proximal map of the nonsmooth component $\operatorname{prox}_{Ξ» h}$.
Keyword Arguments
evaluation::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.p = missingprovide a point to automatically ensure the functions of the objective βactβ on mutating variables.
Manopt.ManifoldProximalMapObjective β Type
ManifoldProximalMapObjective{TC, TP, V} <: AbstractManifoldCostObjective{TC}Specify a problem for solvers based on the evaluation of proximal maps, which represents proximal maps $\operatorname{prox}_{Ξ»f_i}$ for summands $f = f_1 + f_2+ β¦ + f_N$ of the cost function $f$.
Fields
cost: a function $f:\mathcal{M}ββ$ to minimizeproxes: proximal maps $\operatorname{prox}_{Ξ»f_i}:\mathcal{M} β \mathcal{M}$ as functions(M, Ξ», p) -> qor in-place(M, q, Ξ», p).number_of_proxes: number of proximal maps per function, to specify when 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 specified, it is set to one prox per function.
Constructor
ManifoldProximalMapObjective( f, proxes_f::Union{Tuple,AbstractVector}, number_of_proxes=ones(length(proxes_f)) )Generate a proximal problem with a tuple or vector of functions, where by default every function computes a single prox of one component of $f$.
ManifoldProximalMapObjective(f, prox_f)Generate a proximal objective for $f$ and its proximal map $\operatorname{prox}_{Ξ»f}$.
Keyword Arguments
evaluation::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.p = missingprovide a point to automatically ensure the functions of the objective βactβ on mutating variables.
See also
Manopt.ManifoldStochasticGradientObjective β Type
ManifoldStochasticGradientObjective{C, G} <: AbstractManifoldFirstOrderObjective{C, G}A stochastic gradient objective consists of
- a(n optional) cost function $f(p) = \displaystyle\sum_{i=1}^{n} f_i(p)$
- an array of gradients, $\operatorname{grad} f_i(p), i=1,β¦,n$ which can be given in two forms
- as one single function $(\mathcal{M}, p) β¦ (X_1,β¦,X_n) β (T_{p}\mathcal{M})^n$
- as a vector of functions $\bigl( (\mathcal{M}, p) β¦ X_1, β¦, (\mathcal{M}, p) β¦ X_n\bigr)$.
Where both variants are functions (M, X, p) -> X, where X is the vector of X1,...,Xn and (M, X1, p) -> X1, ..., (M, Xn, p) -> Xn, respectively.
Constructors
ManifoldStochasticGradientObjective(grad_f::Function; cost=missing)ManifoldStochasticGradientObjective(grad_f::AbstractVector{<:Function}; cost=missing)Create a Stochastic gradient problem with the gradient either as one function (returning an array of tangent vectors) or a vector of functions (each returning one tangent vector).
The optional cost can also be given as either a single function (returning a number) or a vector of functions, each returning a value.
Keyword Arguments
cost = missingprovide the cost e.g. when it is used in a stopping criterion.evaluation::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.p = missingprovide a point to automatically ensure the functions of the objective βactβ on mutating variables.
Used with
Note that this can also be used with a gradient_descent, since the (complete) gradient is just the sums of the single gradients.
Manopt.ManifoldSubgradientObjective β Type
ManifoldSubgradientObjective{C,S} <: AbstractManifoldCostObjective{C}A structure to store information about an objective for a subgradient based optimization problem
Fields
cost: the function $f$ to be minimizedsubgradient: a function returning a subgradient $βf$ of $f$
Constructor
ManifoldSubgradientObjective(f, βf; evaluation = AllocatingEvaluation(), p = missing)Generate the ManifoldSubgradientObjective for a subgradient objective, consisting of a (cost) function f(M, p) and a function βf(M, p) that returns a not necessarily deterministic element from the subdifferential at p on a manifold M.
Keyword Arguments
evaluation::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.p = missingprovide a point to automatically ensure the functions of the objective βactβ on mutating variables.
Manopt.ScaledManifoldObjective β Type
ScaledManifoldObjective{O2, O1<:AbstractManifoldObjective,F} <: AbstractDecoratedManifoldObjective{O2}Declare an objective to be defined as a scaled version of an existing objective.
This rescales all involved functions.
For now the functions rescaled are
- the cost
- the gradient
- the Hessian
Fields
objective: the objective that is scaledscale=1: the scaling applied
Constructors
ScaledManifoldObjective(objective, scale::Real=1)Generate a scaled manifold objective based on objective, where scale is 1 by default. The unary minus and the multiplication from the left with a scalar are also overloaded.
- objectiveThe single-parameter minus, that is scale=-1, is overloaded to have a short notation turning a maximization problem into a minimization one, which fits the framework provided within Manopt.jl.
scale * objectiveEquivalent to the first constructor, but might be nicer to write in a few places.
Manopt.SimpleManifoldCachedObjective β Type
SimpleManifoldCachedObjective{O<:AbstractManifoldObjective, P, T, C} <: AbstractDecoratedManifoldObjective{O}Provide a simple cache for an AbstractManifoldFirstOrderObjective that is, this cache stores a point p and a gradient $\operatorname{grad} f(p)$ in X as well as a cost value $f(p)$ in c. It can also easily evaluate the differential based on the cached gradient.
Both X and c are accompanied by booleans to keep track of their validity.
While this does not provide a cache for the differential, it uses the cached gradient as a help to evaluate the differential, if an up-to-date gradient is available. It otherwise does call the original differential.
This simple cache does not take into account, that some first order objectives have a common function for cost & grad. It only caches the function that is actually called.
Constructors
SimpleManifoldCachedObjective(M::AbstractManifold, obj::AbstractManifoldFirstOrderObjective; kwargs...)Keyword arguments
p=rand(M): a point on the manifold to initialize the cache withX=get_gradient(M, obj, p)orzero_vector(M,p): a tangent vector to store the gradient in, see alsoinitialized=c=get_cost(M, obj, p)or0.0: a value to store the cost in, see alsoinitialized=initialized=true: whether to initialize the cachedXandcor not.
where both for p and X copies are generated before they are stored.
SimpleManifoldCachedObjective(obj::AbstractManifoldFirstOrderObjective, p, X, c; initialized = false)Similar as above but initializing all fields directly and without copies and initialized indicated whether the three values correspond to an evaluation from obj.
Manopt.equality_constraints_length β Method
equality_constraints_length(co::ConstrainedManifoldObjective)Return the number of equality constraints of an ConstrainedManifoldObjective. This acts transparently through AbstractDecoratedManifoldObjectives
Manopt.get_cost β Method
get_cost(M::AbstractManifold, emo::EmbeddedManifoldObjective, p)Evaluate the cost function of an objective defined in the embedding by first embedding p before calling the cost function stored in the EmbeddedManifoldObjective.
Manopt.get_cost β Method
get_cost(M::AbstractManifold, nlso::ManifoldNonlinearLeastSquaresObjective, p)Compute the cost of the least squares objective, i.e.
\[\frac{1}{2} \sum_{i=1}^{m} Ο_i \bigl( \lVert F_i(p) \rVert^2 \bigr),\]
where $F_i: \mathcal{M} β β^{n_i}$ is the $i$th block component of length $n_i > 0$ and each $Ο_i: β β β$ is a robustifier function, cf. AbstractRobustifierFunction, one for each such block component.
Manopt.get_cost β Method
get_cost(M::AbstractManifold, scaled_objective::ScaledManifoldObjective, p)Evaluate the scaled objective $s*f(p)$.
Manopt.get_cost β Method
get_cost(M::AbstractManifold, sgo::ManifoldStochasticGradientObjective, p, i)Evaluate the ith summand of the cost.
If you use a single function for the stochastic cost, then only the index i=1 is available to evaluate the whole cost.
Manopt.get_cost_smooth β Method
get_cost_smooth(M::AbstractManifold, objective, p)Helper function to extract the smooth part g of a proximal gradient objective at the point p.
Manopt.get_count β Function
get_count(co::ManifoldCountObjective, s::Symbol, mode::Symbol=:None)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
:None: (default) silent mode, returns-1for non-existing entries:warn: issues a warning if a field does not exist:error: issues an error if a field does not exist
Manopt.get_equality_constraint β Function
get_equality_constraint(amp::AbstractManoptProblem, p, j=:)
get_equality_constraint(M::AbstractManifold, objective, p, j=:)Evaluate equality constraints of a ConstrainedManifoldObjective objective at point p and indices j (by default : which corresponds to all indices).
Manopt.get_equality_constraint β Method
get_equality_constraint(M::AbstractManifold, emo::EmbeddedManifoldObjective, p, j)Evaluate the jth equality constraint $h_j(p)$ defined in the embedding, that is embed p before calling the constraint functions stored in the EmbeddedManifoldObjective.
Manopt.get_grad_equality_constraint β Function
get_grad_equality_constraint(amp::AbstractManoptProblem, p, j)
get_grad_equality_constraint(M::AbstractManifold, co::ConstrainedManifoldObjective, p, j, range=NestedPowerRepresentation())
get_grad_equality_constraint!(amp::AbstractManoptProblem, X, p, j)
get_grad_equality_constraint!(M::AbstractManifold, X, co::ConstrainedManifoldObjective, p, j, range=NestedPowerRepresentation())Evaluate the gradient or gradients of the equality constraint $(\operatorname{grad} h(p))_j$ or $\operatorname{grad} h_j(p)$,
See also the ConstrainedManoptProblem to specify the range of the gradient.
Manopt.get_grad_equality_constraint β Method
X = get_grad_equality_constraint(M::AbstractManifold, emo::EmbeddedManifoldObjective, p, j)
get_grad_equality_constraint!(M::AbstractManifold, X, emo::EmbeddedManifoldObjective, p, j)Evaluate the gradient of the jth equality constraint $\operatorname{grad} h_j(p)$ defined in the embedding, that is embed p before calling the gradient function stored in the EmbeddedManifoldObjective.
The returned gradient is then converted to a Riemannian gradient calling riemannian_gradient.
Manopt.get_grad_inequality_constraint β Function
get_grad_inequality_constraint(amp::AbstractManoptProblem, p, j=:)
get_grad_inequality_constraint(M::AbstractManifold, co::ConstrainedManifoldObjective, p, j=:, range=NestedPowerRepresentation())
get_grad_inequality_constraint!(amp::AbstractManoptProblem, X, p, j=:)
get_grad_inequality_constraint!(M::AbstractManifold, X, co::ConstrainedManifoldObjective, p, j=:, range=NestedPowerRepresentation())Evaluate the gradient or gradients of the inequality constraint $(\operatorname{grad} g(p))_j$ or $\operatorname{grad} g_j(p)$,
See also the ConstrainedManoptProblem to specify the range of the gradient.
Manopt.get_grad_inequality_constraint β Method
X = get_grad_inequality_constraint(M::AbstractManifold, emo::EmbeddedManifoldObjective, p, j)
get_grad_inequality_constraint!(M::AbstractManifold, X, emo::EmbeddedManifoldObjective, p, j)Evaluate the gradient of the jth inequality constraint $\operatorname{grad} g_j(p)$ defined in the embedding, that is embed p before calling the gradient function stored in the EmbeddedManifoldObjective.
The returned gradient is then converted to a Riemannian gradient calling riemannian_gradient.
Manopt.get_gradient β Method
get_gradient(M::AbstractManifold, nlso::ManifoldNonlinearLeastSquaresObjective, p; kwargs...)
get_gradient!(M::AbstractManifold, X, nlso::ManifoldNonlinearLeastSquaresObjective, p; kwargs...)Compute the gradient for the ManifoldNonlinearLeastSquaresObjective nlso at the point $p β M$, i.e.
\[\operatorname{grad} f(p) = \sum_{i=1}^{m} Ο'_i\bigl(\lVert F_i(p) \rVert_{2}^2\bigr) \sum_{j=1}^{n_i} f_{i,j}(p) \operatorname{grad} f_{i,j}(p)\]
where $F_i(p) β β^{n_i}$ is the vector of residuals for the i-th block component cost function and $f_{i,j}(p)$ its j-th component function.
Keyword arguments
value_cache=nothing: if provided, this vector is used to store the residuals $F(p)$ internally to avoid re-computations.jacobian_cache=fill(nothing, length(nlso.objective)): if provided, this is used to store the Jacobians of the component functions.
Manopt.get_gradient β Method
get_gradient(M::AbstractManifold, mgo::ManifoldProximalGradientObjective, p)
get_gradient!(M::AbstractManifold, X, mgo::ManifoldProximalGradientObjective, p)Evaluate the gradient of the smooth part of a ManifoldProximalGradientObjective mgo at p.
Manopt.get_gradient β Method
get_gradient(M::AbstractManifold, sgo::ManifoldStochasticGradientObjective, p, k)
get_gradient!(M::AbstractManifold, X, sgo::ManifoldStochasticGradientObjective, p, k)Evaluate one of the summands gradients $\operatorname{grad}f_k$, $k β \{1,β¦,n\}$, at p (in place of X).
If you use a single function for the stochastic gradient, that works in-place, then get_gradient is not available, since the length (or number of elements of the gradient required for allocation) can not be determined.
Manopt.get_gradient β Method
get_gradient(M::AbstractManifold, scaled_objective::ScaledManifoldObjective, p)
get_gradient!(M::AbstractManifold, X, scaled_objective::ScaledManifoldObjective, p)Evaluate the scaled gradient $s*\operatorname{grad}f(p)$.
Manopt.get_gradient β Method
get_gradient(M::AbstractManifold, sgo::ManifoldStochasticGradientObjective, p)
get_gradient!(M::AbstractManifold, X, sgo::ManifoldStochasticGradientObjective, p)Evaluate the complete gradient $\operatorname{grad} f = \displaystyle\sum_{i=1}^{n} \operatorname{grad} f_i(p)$ at p (in place of X).
If you use a single function for the stochastic gradient, that works in-place, then get_gradient is not available, since the length (or number of elements of the gradient required for allocation) can not be determined.
Manopt.get_gradient β Method
get_gradient(M::AbstractManifold, emo::EmbeddedManifoldObjective, p)
get_gradient!(M::AbstractManifold, X, emo::EmbeddedManifoldObjective, p)Evaluate the gradient function of an objective defined in the embedding, that is embed p before calling the gradient function stored in the EmbeddedManifoldObjective.
The returned gradient is then converted to a Riemannian gradient calling riemannian_gradient.
Manopt.get_gradients β Method
get_gradients(M::AbstractManifold, sgo::ManifoldStochasticGradientObjective, p)
get_gradients!(M::AbstractManifold, X, sgo::ManifoldStochasticGradientObjective, p)Evaluate all summands gradients $\{\operatorname{grad}f_i\}_{i=1}^{n}$ at p and return them as a vector.
This can be done in-place of a vector of tangent vectors X.
Manopt.get_hess_equality_constraint β Function
get_hess_equality_constraint(amp::AbstractManoptProblem, p, j=:)
get_hess_equality_constraint(M::AbstractManifold, co::ConstrainedManifoldObjective, p, j, range=NestedPowerRepresentation())
get_hess_equality_constraint!(amp::AbstractManoptProblem, X, p, j=:)
get_hess_equality_constraint!(M::AbstractManifold, X, co::ConstrainedManifoldObjective, p, j, range=NestedPowerRepresentation())Evaluate the Hessian or Hessians of the equality constraint $(\operatorname{Hess} h(p))_j$ or $\operatorname{Hess} h_j(p)$,
See also the ConstrainedManoptProblem to specify the range of the Hessian.
Manopt.get_hess_inequality_constraint β Function
get_hess_inequality_constraint(amp::AbstractManoptProblem, p, X, j=:)
get_hess_inequality_constraint(M::AbstractManifold, co::ConstrainedManifoldObjective, p, j=:, range=NestedPowerRepresentation())
get_hess_inequality_constraint!(amp::AbstractManoptProblem, Y, p, j=:)
get_hess_inequality_constraint!(M::AbstractManifold, Y, co::ConstrainedManifoldObjective, p, X, j=:, range=NestedPowerRepresentation())Evaluate the Hessian or Hessians of the inequality constraint $(\operatorname{Hess} g(p)[X])_j$ or $\operatorname{Hess} g_j(p)[X]$,
See also the ConstrainedManoptProblem to specify the range of the Hessian.
Manopt.get_hessian β Method
get_hessian(M::AbstractManifold, scaled_objective::ScaledManifoldObjective, p, X)
get_hessian!(M::AbstractManifold, Y, scaled_objective::ScaledManifoldObjective, p, X)Evaluate the scaled Hessian $s*\operatorname{Hess}f(p)$.
Manopt.get_hessian β Method
get_hessian(M::AbstractManifold, emo::EmbeddedManifoldObjective, p, X)
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 Hessian function stored in the EmbeddedManifoldObjective.
The returned Hessian is then converted to a Riemannian Hessian calling riemannian_Hessian.
Manopt.get_inequality_constraint β Function
get_inequality_constraint(amp::AbstractManoptProblem, p, j=:)
get_inequality_constraint(M::AbstractManifold, co::ConstrainedManifoldObjective, p, j=:, range=NestedPowerRepresentation())Evaluate inequality constraints of a ConstrainedManifoldObjective objective at point p and indices j (by default : which corresponds to all indices).
Manopt.get_inequality_constraint β Method
get_inequality_constraint(M::AbstractManifold, emo::EmbeddedManifoldObjective, p, i)Evaluate the ith inequality constraint $g_i(p)$ defined in the embedding, that is embed p before calling the constraint functions stored in the EmbeddedManifoldObjective.
Manopt.get_preconditioner β Method
get_preconditioner(M::AbstractManifold, mho::ManifoldHessianObjective, p, X)Evaluate the preconditioner of the ManifoldHessianObjective mho at the point p, applied to the tangent vector X.
It usually is a symmetric, positive definite approximation of the inverse of the Hessian of the cost function f.
Manopt.get_projected_point! β Method
get_projected_point(amp::AbstractManoptProblem, p)
get_projected_point!(amp::AbstractManoptProblem, q, p)
get_projected_point(M::AbstractManifold, cso::ManifoldConstrainedSetObjective, p)
get_projected_point!(M::AbstractManifold, q, cso::ManifoldConstrainedSetObjective, p)Project p with the projection that is stored within the ManifoldConstrainedSetObjective. This can be done in-place of q.
Manopt.get_projected_point! β Method
get_projected_point(amp::AbstractManoptProblem, p)
get_projected_point!(amp::AbstractManoptProblem, q, p)
get_projected_point(M::AbstractManifold, cso::ManifoldConstrainedSetObjective, p)
get_projected_point!(M::AbstractManifold, q, cso::ManifoldConstrainedSetObjective, p)Project p with the projection that is stored within the ManifoldConstrainedSetObjective. This can be done in-place of q.
Manopt.get_projected_point β Method
get_projected_point(amp::AbstractManoptProblem, p)
get_projected_point!(amp::AbstractManoptProblem, q, p)
get_projected_point(M::AbstractManifold, cso::ManifoldConstrainedSetObjective, p)
get_projected_point!(M::AbstractManifold, q, cso::ManifoldConstrainedSetObjective, p)Project p with the projection that is stored within the ManifoldConstrainedSetObjective. This can be done in-place of q.
Manopt.get_projected_point β Method
get_projected_point(amp::AbstractManoptProblem, p)
get_projected_point!(amp::AbstractManoptProblem, q, p)
get_projected_point(M::AbstractManifold, cso::ManifoldConstrainedSetObjective, p)
get_projected_point!(M::AbstractManifold, q, cso::ManifoldConstrainedSetObjective, p)Project p with the projection that is stored within the ManifoldConstrainedSetObjective. This can be done in-place of q.
Manopt.get_proximal_map β Method
q = get_proximal_map(M::AbstractManifold, mpo::ManifoldProximalGradientObjective, Ξ», p)
get_proximal_map!(M::AbstractManifold, q, mpo::ManifoldProximalGradientObjective, Ξ», p)Evaluate the proximal map of the nonsmooth component $h$ of the ManifoldProximalGradientObjective mpo at the point p on M with parameter $Ξ»>0$.
Manopt.get_proximal_map β Method
q = get_proximal_map(M::AbstractManifold, mpo::ManifoldProximalMapObjective, Ξ», p)
get_proximal_map!(M::AbstractManifold, q, mpo::ManifoldProximalMapObjective, Ξ», p)
q = get_proximal_map(M::AbstractManifold, mpo::ManifoldProximalMapObjective, Ξ», p, i)
get_proximal_map!(M::AbstractManifold, q, mpo::ManifoldProximalMapObjective, Ξ», p, i)Evaluate the (ith) proximal map of the ManifoldProximalMapObjective mpo at the point p of M with parameter $Ξ»>0$.
Manopt.get_residuals! β Method
get_residuals(M::AbstractManifold, nlso::ManifoldNonlinearLeastSquaresObjective, p)
get_residuals!(M::AbstractManifold, v, nlso::ManifoldNonlinearLeastSquaresObjective, p)Compute the vector of residuals $F(p) β β^n$, $n = \sum_{i=1}^{m} n_i$. In other words this is the concatenation of the residual vectors $F_i(p)$, $i=1,β¦,m$ of the components of the ManifoldNonlinearLeastSquaresObjective nlso at the current point $p$ on M.
This can be computed in-place of v.
Note that even in the presence of RobustifierFunctions, these are not applied here, this function computes the βpureβ residuals.
Manopt.get_residuals β Method
get_residuals(M::AbstractManifold, nlso::ManifoldNonlinearLeastSquaresObjective, p)
get_residuals!(M::AbstractManifold, v, nlso::ManifoldNonlinearLeastSquaresObjective, p)Compute the vector of residuals $F(p) β β^n$, $n = \sum_{i=1}^{m} n_i$. In other words this is the concatenation of the residual vectors $F_i(p)$, $i=1,β¦,m$ of the components of the ManifoldNonlinearLeastSquaresObjective nlso at the current point $p$ on M.
This can be computed in-place of v.
Note that even in the presence of RobustifierFunctions, these are not applied here, this function computes the βpureβ residuals.
Manopt.get_subgradient β Method
X = get_subgradient(M::AbstractManifold, sgo::ManifoldSubgradientObjective, p)
get_subgradient!(M::AbstractManifold, X, sgo::ManifoldSubgradientObjective, p)Evaluate the (sub)gradient of a ManifoldSubgradientObjective sgo at the point p.
The evaluation is done in place of X for the !-variant. The result might not be deterministic, one element of the subdifferential is returned.
Manopt.get_unconstrained_objective β Method
get_unconstrained_objective(co::ConstrainedManifoldObjective)Returns the internally stored unconstrained AbstractManifoldObjective within the ConstrainedManifoldObjective.
Manopt.inequality_constraints_length β Method
inequality_constraints_length(cmo::ConstrainedManifoldObjective)Return the number of inequality constraints of an ConstrainedManifoldObjective cmo. This acts transparently through AbstractDecoratedManifoldObjectives
Manopt.is_feasible β Method
is_feasible(M::AbstractManifold, cmo::ConstrainedManifoldObjective, p; kwargs...)
is_feasible(M::AbstractManifold, o::AbstractDecoratedManifoldObjective, p; kwargs...)Evaluate whether a point p on M is feasible with respect to the ConstrainedManifoldObjective cmo. That is for the provided inequality constraints $g: \mathcal{M} β β^m$ and equality constraints $h: \mathcal{M} β β^m$ from within cmo, the point $p β \mathcal{M}$ is feasible if
\[g_i(p) β€ 0, \text{ for all } i=1,β¦,m\quad ext{ and }\quad h_j(p) = 0, ext{ for all } j=1,β¦,n.\]
Keyword arguments
check_point::Bool=true: whether to also verify that $pβ\mathcal{M}$ holds, usingis_pointerror::Symbol=:none: if the point is not feasible, this symbol determines how to report the error.:error: throws an error:info: displays the error message as an @info:none: (default) the function just returns true/false:warn: displays the error message as a @warning.
The keyword error= and all other kwargs... are passed on to is_point if the point is verified (see check_point).
Manopt.objective_cache_factory β Method
objective_cache_factory(M::AbstractManifold, o::AbstractManifoldObjective, cache::Symbol)Generate a cached variant of the AbstractManifoldObjective o on the AbstractManifold M based on the symbol cache.
The following caches are available
:Simplegenerates aSimpleManifoldCachedObjective:LRUgenerates aManifoldCachedObjectivewhere you should use the form(:LRU, [:Cost, :Gradient])to specify what should be cached or(:LRU, [:Cost, :Gradient], 100)to specify the cache size. Here this variant defaults to(:LRU, [:Cost, :Gradient], 100), caching up to 100 cost and gradient values.[1]
Manopt.objective_cache_factory β Method
objective_cache_factory(M::AbstractManifold, o::AbstractManifoldObjective, cache::Tuple{Symbol, Array, Array})
objective_cache_factory(M::AbstractManifold, o::AbstractManifoldObjective, cache::Tuple{Symbol, Array})Generate a cached variant of the AbstractManifoldObjective o on the AbstractManifold M, selected by cache[1].
The second element cache[2] provides further arguments to the cache and the optional third is passed down as keyword arguments.
For all available caches see the simpler variant with symbols.
Manopt.reset_counters! β Function
reset_counters!(co::ManifoldCountObjective, value::Integer=0)Reset all values in the count objective to value.
Internal functions
Manopt.get_cost_and_differential β Method
get_cost_and_differential(
M, mfo::ManifoldFirstOrderObjective, p, X;
gradient = missing, evaluated::Bool = false,
)Evaluate cost function and differential simultaneously.
This combined evaluation is especially beneficial when you provided a combined costdifferential function within the ManifoldFirstOrderObjective mfo. When there is no separate differential, the evaluation falls back to evaluating the gradient and an inner product.
Input
M::AbstractManifold: a Riemannian manifold $\mathcal{M}$mfoanManifoldFirstOrderObjectivep::P: a point on the manifold $\mathcal{M}$X::T: a tangent vector at the point $p$ on the manifold $\mathcal{M}$
Keyword Arguments
gradient = missingprovide a cache/memory to evaluate the gradient in. if not provided, this function will allocate one tangent vectorevaluated = falseif the cache is provided, this boolean specifies, whether the cache already contains the evaluated gradient and does not need to evaluate the gradient again, if possible. For example for a combinedcostgradfunction, the evaluation can not be avoided, since we need the cost value.
Manopt.get_feasibility_status β Method
get_feasibility_status(
M::AbstractManifold,
cmo::ConstrainedManifoldObjective,
g = get_inequality_constraints(M, cmo, p),
h = get_equality_constraints(M, cmo, p),
)Generate a message about the feasibiliy of p with respect to the ConstrainedManifoldObjective. You can also provide the evaluated vectors for the values of g and h as keyword arguments, in case you had them evaluated before.
Manopt.get_subgradient_function β Function
get_subgradient_function(objective::ManifoldSubgradientObjective, recursive=false; evaluation = AllocatingEvaluation())Return the function to evaluate (just) the subgradient $β f(p)$. It is of the form (M, X, p) -> X to work in-place of X, where either the subgradient function using the decorator or without the decorator is used.
By default recursive is set to false, since usually to just pass the gradient function somewhere, one still wants for example the cached one or the one that still counts calls.
Manopt.init_caches β Function
init_caches(M::AbstractManifold, caches, T; kwargs...)Given a vector of symbols caches, this function sets up the NamedTuple of caches for points/vectors on M, where T is the type of cache to use.
Manopt.residuals_count β Method
residuals_count(nlso::ManifoldNonlinearLeastSquaresObjective)Return the total number of residuals in ManifoldNonlinearLeastSquaresObjective nlso, which is the sum of the single block components lengths.
Linear systems
Manopt.SymmetricLinearSystemObjective β Type
SymmetricLinearSystemObjective{TA,T} <: AbstractSymmetricLinearSystemObjectiveModel the objective
\[f(X) = \frac{1}{2} \lVert \mathcal{A}[X] + b \rVert_{p}^2,\qquad X β T_{p}\mathcal{M},\]
defined on the tangent space $T_{p}\mathcal{M}$ at $p$ on the manifold $\mathcal{M}$.
In other words this is an objective to solve $\mathcal{A}[X] = -b(p)$ for some linear symmetric operator $\mathcal{A}$ and a vector function $b$. Note the minus on the right hand side, which makes this objective especially tailored for (iteratively) solving Newton-like equations.
Fields
A!: a symmetric, linear operator on the tangent space, seeget_linear_operatorb!: a tangent vector function, seeget_vector_field
where A! is implemented as in-place operator (M, Y, p, X) -> Y, and similarly b! is a function (M, X, p) -> X implemented to work in-place of X.
Constructor
SymmetricLinearSystemObjective(A, b; evaluation=AllocatingEvaluation(), p = missing)Generate the objective specifying whether the two parts work allocating or in-place.
Keyword Arguments
evaluation::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.p = missingprovide a point to automatically ensure the functions of the objective βactβ on mutating variables.
Internal functions
Manopt.get_linear_operator β Method
Y = get_linear_operator(M::AbstractManifold, slso::SymmetricLinearSystemObjective, p, X)
get_linear_operator!(M::AbstractManifold, Y, slso::SymmetricLinearSystemObjective, p, X)Evaluate the linear operator $W = \mathcal{A}[X]$ from the SymmetricLinearSystemObjective defined on the tangent space at p at the tangent vector X.
This can be evaluated in-place of Y.
Manopt.get_vector_field! β Method
get_vector_field(M::AbstractManifold, slso::SymmetricLinearSystemObjective, p)
get_vector_field!(M::AbstractManifold, Y, slso::SymmetricLinearSystemObjective, p)
get_vector_field(TpM::TangentSpace, slso::SymmetricLinearSystemObjective)
get_vector_field!(TpM::TangentSpace, Y, slso::SymmetricLinearSystemObjective)Evaluate the stored value for computing the right hand side $b$ in $\mathcal{A}[X] = -b$, either providing a tangent space or a manifold and a point.
This can be evaluated in-place of Y.
Manopt.get_vector_field β Method
get_vector_field(M::AbstractManifold, slso::SymmetricLinearSystemObjective, p)
get_vector_field!(M::AbstractManifold, Y, slso::SymmetricLinearSystemObjective, p)
get_vector_field(TpM::TangentSpace, slso::SymmetricLinearSystemObjective)
get_vector_field!(TpM::TangentSpace, Y, slso::SymmetricLinearSystemObjective)Evaluate the stored value for computing the right hand side $b$ in $\mathcal{A}[X] = -b$, either providing a tangent space or a manifold and a point.
This can be evaluated in-place of Y.
Manopt.get_vector_field β Method
get_vector_field(M::AbstractManifold, slso::SymmetricLinearSystemObjective, p)
get_vector_field!(M::AbstractManifold, Y, slso::SymmetricLinearSystemObjective, p)
get_vector_field(TpM::TangentSpace, slso::SymmetricLinearSystemObjective)
get_vector_field!(TpM::TangentSpace, Y, slso::SymmetricLinearSystemObjective)Evaluate the stored value for computing the right hand side $b$ in $\mathcal{A}[X] = -b$, either providing a tangent space or a manifold and a point.
This can be evaluated in-place of Y.
Sub objectives
Manopt.AugmentedLagrangianCost β Type
AugmentedLagrangianCost{CO,R,T} <: AbstractConstrainedFunction{CO}Stores the parameters $Ο β β$, $ΞΌ β β^m$, $Ξ» β β^n$ of the augmented Lagrangian associated to the ConstrainedManifoldObjective co.
This struct is also a functor (M,p) -> v that can be used as a cost function within a solver, based on the internal ConstrainedManifoldObjective it computes
\[\mathcal{L}_Ο(p, ΞΌ, Ξ») = f(p) + \frac{Ο}{2}\biggl( \sum_{j=1}^{n}\Bigl( h_j(p) + \frac{Ξ»_j}{Ο} \Bigr)^2 + \sum_{i=1}^{m}\max\{0, \frac{ΞΌ_i}{Ο} + g_i(p)\}^2 \biggr)\]
Fields
co::CO,Ο::R,ΞΌ::T,Ξ»::Tas mentioned in the formula, whereRshould be the number type used andTthe vector type.
Constructor
AugmentedLagrangianCost(co, Ο, ΞΌ, Ξ»)Manopt.AugmentedLagrangianGrad β Type
AugmentedLagrangianGrad{CO,R,T} <: AbstractConstrainedFunction{T}Stores the parameters $Ο β β$, $ΞΌ β β^m$, $Ξ» β β^n$ of the augmented Lagrangian associated to the ConstrainedManifoldObjective co.
This struct is also a functor in both formats
(M, p) -> Xto compute the gradient in allocating fashion.(M, X, p)to compute the gradient in an in-place fashion.
Additionally this gradient accepts a positional last argument to specify the range for the internal gradient call of the constrained objective.
Based on the internal ConstrainedManifoldObjective, it computes the gradient $\operatorname{grad}\mathcal{L}_{Ο}(p, ΞΌ, Ξ»)$, see also AugmentedLagrangianCost.
Fields
co::CO,Ο::R,ΞΌ::T,Ξ»::Tas mentioned in the formula, whereRshould be the number type used andTthe vector type.
Constructor
AugmentedLagrangianGrad(co, Ο, ΞΌ, Ξ»)Manopt.LevenbergMarquardtLinearSurrogateObjective β Type
LevenbergMarquardtLinearSurrogateObjective{R<:Real,TO,TVC} <: AbstractLevenbergMarquardtLinearSurrogateObjectiveThe linear surrogate objective for a ManifoldNonlinearLeastSquaresObjective.
Given an ManifoldNonlinearLeastSquaresObjective objective and a penalty $Ξ»$, this objective represents the penalized objective for the sub-problem to solve within every step of the Levenberg-Marquardt algorithm following the ideas of [TMHF00] given by
\[ΞΌ_p(X) = \frac{1}{2}\lVert \mathcal{L}(X) + y \rVert_{2}^2 + \frac{Ξ»}{2}\lVert X \rVert_{p}^2, \qquad\text{ for }X β T_{p}\mathcal{M}, Ξ» β₯ 0,\]
where $X β T_{p}\mathcal{M}$, $Ξ» β₯ 0$ is the damping or penalty term, $\mathcal{L}: T_{p}\mathcal{M} β β^n$ is a linear operator, and $y = y(p) β β^n$ is a vector field. For the derivation of the Riemannian case, see [BB26].
In order to build a surrogate also for the robustified Levenberg-Marquardt, introduce $Ξ± = 1 - \sqrt{1 + 2 \frac{Ο''(p)}{Ο'(p)}\lVert F(p) \rVert_{2}^2}$ and set $y = \frac{\sqrt{Ο'(p)}}{1-Ξ±}F(p)$ and $\mathcal{L}(X) = CJ_F(p)[X]$ with
\[C = \sqrt{Ο'(p)}(I-Ξ±P), \qquad P = \frac{F(p)F(p)^\mathrm{T}}{\lVert F(p) \rVert_{2}^2},\]
where $F(p) β β^n$ is the vector of residuals at point $p β M$ and $J_F(p): T_{p}\mathcal{M} β β^n$ is the Jacobian. These two can be accessed with get_vector_field for $y$ and get_linear_operator for $\mathcal{L}$, respectively. For technical details on the scaling using $Ξ±$, especially how the threshold and mode act as safeguards, see get_LevenbergMarquardt_scaling.
Fields
objective: theManifoldNonlinearLeastSquaresObjectiveto penalizepenalty::Real: the damping term $Ξ»$threshold::Real: threshold $Ξ΅$ for stabilization of $Ξ±$ as $Ξ± β€ 1-Ξ΅$, seeget_LevenbergMarquardt_scalingmode::Symbol: which mode to use to stabilize $Ξ±$, see the internal helperget_LevenbergMarquardt_scalingvalue_cache: a vector to store the residuals $F(p)$ at the current pointpinternally to avoid re-computations
Constructor
LevenbergMarquardtLinearSurrogateObjective(objective; penalty::Real = 1e-6, threshold::Real = 1e-4, mode::Symbol = :Strict, residuals = zeros(residuals_count(get_objective(objective))),)Note that the keyword residuals initializes the value_cache field.
Manopt.TrustRegionModelObjective β Type
TrustRegionModelObjective{O<:AbstractManifoldHessianObjective} <: AbstractManifoldSubObjective{O}A trust region model of the form
\[ m(X) = f(p) + β¨\operatorname{grad} f(p), Xβ©_p + \frac{1}{2} β¨\operatorname{Hess} f(p)[X], Xβ©_p\]
Fields
objective: anAbstractManifoldHessianObjectiveproving $f$, its gradient and Hessian
Constructors
TrustRegionModelObjective(objective)with either an AbstractManifoldHessianObjective objective or an decorator containing such an objective
Manopt.get_cost β Method
get_cost(
M::AbstractManifold, lmsco::LevenbergMarquardtLinearSurrogateObjective, p, X
)Compute the surrogate cost. Let $F$ denote the vector of residuals (of a block), $Ο, Ο'$, $Ο''$ the value, first, and second derivative of the AbstractRobustifierFunction of the inner ManifoldNonlinearLeastSquaresObjective
\[Ο_k(X) = \frac{1}{2}\lVert y + \mathcal{L}(X) \rVert_{2}^2, \qquad X β T_{p}\mathcal{M}\]
where
- $\mathcal{L}(X) = CJ[X]$ see
get_linear_operatorwith apenaltyof zero. - $y$ the rescaled vector field, see
get_vector_field
Manopt.get_cost β Method
get_cost(TpM::TangentSpace, neo::NormalEquationsObjective{<:LevenbergMarquardtLinearSurrogateObjective}, X)Compute the surrogate cost when solving its normal equations.
See also get_cost(::AbstractManifold, ::LevenbergMarquardtLinearSurrogateObjective, p, X), get_linear_operator, and get_vector_field for more details.
Manopt.get_cost β Method
get_cost(TpM, trmo::TrustRegionModelObjective, X)Evaluate the tangent space TrustRegionModelObjective
\[m(X) = f(p) + β¨\operatorname{grad} f(p), X β©_p + \frac{1}{2} β¨\operatorname{Hess} f(p)[X], Xβ©_p.\]
Manopt.get_gradient! β Method
get_gradient(M::AbstractManifold, lmsco::LevenbergMarquardtLinearSurrogateObjective, p, X)
get_gradient!(M::AbstractManifold, Y, lmsco::LevenbergMarquardtLinearSurrogateObjective, p, X)Compute the gradient of the LevenbergMarquardtLinearSurrogateObjective, which is given by
\[\begin{aligned} \operatorname{grad} ΞΌ_p(X) &= \sum_{i=1}^{m} \mathcal{L}_i^*\bigl(\mathcal{L}_i(X) + y_i \bigr) + Ξ»X\\\\ &= \sum_{i=1}^{m} J_{F_i}^*(p)\Bigl[ Ο_i' \bigl(I- b F_i(p)F_i(p)^{\mathrm{T}}\bigr)^2 J_{F_i}(p)[X] + a\sqrt{Ο_i'}\bigl(I- b F_i(p)F_i(p)^{\mathrm{T}}\bigr) F_i(p) + Ξ»X \Bigr] \end{aligned} \]
where $Ο_i' = Ο_i'(\lVert F_i(p) \rVert_2^2)$, $Ο_i'' = Ο_i''(\lVert F_i(p) \rVert_2^2)$ are the values from the AbstractRobustifierFunction Ο its first and second derivative, respectively, and $a,b$ are the get_LevenbergMarquardt_scaling values of scaling the residual and operator, respectively. See also get_jacobian and get_adjoint_jacobian.
This can be computed inplace of Y.
Manopt.get_gradient β Method
get_gradient(M::AbstractManifold, lmsco::LevenbergMarquardtLinearSurrogateObjective, p, X)
get_gradient!(M::AbstractManifold, Y, lmsco::LevenbergMarquardtLinearSurrogateObjective, p, X)Compute the gradient of the LevenbergMarquardtLinearSurrogateObjective, which is given by
\[\begin{aligned} \operatorname{grad} ΞΌ_p(X) &= \sum_{i=1}^{m} \mathcal{L}_i^*\bigl(\mathcal{L}_i(X) + y_i \bigr) + Ξ»X\\\\ &= \sum_{i=1}^{m} J_{F_i}^*(p)\Bigl[ Ο_i' \bigl(I- b F_i(p)F_i(p)^{\mathrm{T}}\bigr)^2 J_{F_i}(p)[X] + a\sqrt{Ο_i'}\bigl(I- b F_i(p)F_i(p)^{\mathrm{T}}\bigr) F_i(p) + Ξ»X \Bigr] \end{aligned} \]
where $Ο_i' = Ο_i'(\lVert F_i(p) \rVert_2^2)$, $Ο_i'' = Ο_i''(\lVert F_i(p) \rVert_2^2)$ are the values from the AbstractRobustifierFunction Ο its first and second derivative, respectively, and $a,b$ are the get_LevenbergMarquardt_scaling values of scaling the residual and operator, respectively. See also get_jacobian and get_adjoint_jacobian.
This can be computed inplace of Y.
Manopt.get_gradient β Method
get_gradient(TpM, trmo::TrustRegionModelObjective, X)Evaluate the gradient of the TrustRegionModelObjective
\[\operatorname{grad} m(X) = \operatorname{grad} f(p) + \operatorname{Hess} f(p)[X].\]
Manopt.get_hessian! β Method
get_hessian(M::AbstractManifold, lmsco::LevenbergMarquardtLinearSurrogateObjective, p, X, Y)
get_hessian!(M::AbstractManifold, Z, lmsco::LevenbergMarquardtLinearSurrogateObjective, p, X, Y)Compute the Hessian of the LevenbergMarquardtLinearSurrogateObjective, which is given by
\[\begin{aligned} \operatorname{Hess} ΞΌ_p(X)[Y] &= \sum_{i=1}^{m} \mathcal{L}_i^*\bigl(\mathcal{L}_i(Y)\bigr) + Ξ»Y\\\\ &= \sum_{i=1}^{m} J_{F_i}^*(p)\Bigl[ Ο_i' \bigl(I- b F_i(p)F_i(p)^{\mathrm{T}}\bigr)^2 J_{F_i}(p)[Y] + Ξ»Y \Bigr] \end{aligned} \]
where $Ο_i' = Ο_i'(\lVert F_i(p) \rVert_2^2)$, $Ο_i'' = Ο_i''(\lVert F_i(p) \rVert_2^2)$ are the values from the AbstractRobustifierFunction Ο its first and second derivative, respectively, and $b$ is the get_LevenbergMarquardt_scaling values of scaling the operator. See also get_jacobian and get_adjoint_jacobian.
This can be computed inplace of Z.
Manopt.get_hessian β Method
get_hessian(M::AbstractManifold, lmsco::LevenbergMarquardtLinearSurrogateObjective, p, X, Y)
get_hessian!(M::AbstractManifold, Z, lmsco::LevenbergMarquardtLinearSurrogateObjective, p, X, Y)Compute the Hessian of the LevenbergMarquardtLinearSurrogateObjective, which is given by
\[\begin{aligned} \operatorname{Hess} ΞΌ_p(X)[Y] &= \sum_{i=1}^{m} \mathcal{L}_i^*\bigl(\mathcal{L}_i(Y)\bigr) + Ξ»Y\\\\ &= \sum_{i=1}^{m} J_{F_i}^*(p)\Bigl[ Ο_i' \bigl(I- b F_i(p)F_i(p)^{\mathrm{T}}\bigr)^2 J_{F_i}(p)[Y] + Ξ»Y \Bigr] \end{aligned} \]
where $Ο_i' = Ο_i'(\lVert F_i(p) \rVert_2^2)$, $Ο_i'' = Ο_i''(\lVert F_i(p) \rVert_2^2)$ are the values from the AbstractRobustifierFunction Ο its first and second derivative, respectively, and $b$ is the get_LevenbergMarquardt_scaling values of scaling the operator. See also get_jacobian and get_adjoint_jacobian.
This can be computed inplace of Z.
Manopt.get_hessian β Method
get_hessian(TpM, trmo::TrustRegionModelObjective, X)Evaluate the Hessian of the TrustRegionModelObjective
\[\operatorname{Hess} m(X)[Y] = \operatorname{Hess} f(p)[Y].\]
Internal functions
Manopt.AbstractLevenbergMarquardtLinearSurrogateObjective β Type
AbstractLevenbergMarquardtLinearSurrogateObjectiveAbstract supertype for Levenberg-Marquardt surrogates like LevenbergMarquardtLinearSurrogateObjective and LevenbergMarquardtLinearSurrogateCoordinatesObjective.
Manopt.LevenbergMarquardtLinearSurrogateCoordinatesObjective β Type
LevenbergMarquardtLinearSurrogateCoordinatesObjective{R<:Real,TO,TVC,TJC,TB} <: AbstractLevenbergMarquardtLinearSurrogateObjectiveA subobjective similar to LevenbergMarquardtLinearSurrogateObjective but which uses coordinate-based Jacobians in a single, selected basis instead of being centered around linear operators.
Fields
objective: theManifoldNonlinearLeastSquaresObjectiveto penalizepenalty::Real: the damping term $Ξ»$threshold::Real: stabilization $Ξ΅$ for $Ξ± β€ 1-Ξ΅$ in the rescaling of the residual and Jacobian, seeget_LevenbergMarquardt_scalingmode::Symbol: which mode to use to stabilize Ξ±, see the internal helperget_LevenbergMarquardt_scalingvalue_cache: a vector to store the residuals $F(p)$ at the current pointpinternally to avoid recomputationsjacobian_cache: a vector to store the coordinate-based Jacobian of the residuals at the current pointpinternally to avoid recomputations. If the Jacobian is used as a linear operator, this is just a vector ofnothings.basis: theAbstractBasisthe coordinates refer to
Constructor
LevenbergMarquardtLinearSurrogateCoordinatesObjective(objective; penalty::Real = 1e-6, threshold::Real = 1e-4, mode::Symbol = :Strict, residuals = zeros(residuals_count(get_objective(objective))), jacobian_cache = fill(nothing, length(get_objective(objective).objective)), basis = DefaultOrthonormalBasis(),)Note that the keyword residuals initializes the value_cache field.
Manopt.NormalEquationsObjective β Type
NormalEquationsObjective{O <: AbstractLinearSurrogateObjective} <: AbstractSymmetricLinearSystemObjectiveA AbstractLinearSurrogateObjective might be overdetermined, and it usually is overdetermined, e.g. for the case of the LevenbergMarquardt algorithm. For this case, one considers the normal equations.
This wrapper provides the same three functions as the wrapped surrogate
get_linear_operatorto compute/evaluate the linear operator $\mathcal{L}$get_vector_fieldto compute/evaluate the vector $y$get_objectiveto provide access to the underlying surrogate
so that we obtain a symmetric linear system of equations, that can be
- solved with an iterative method like
conjugate_gradient_descentorconjugate_residual - solved as a linear system in a basis of the corresponding tangent space.
Manopt.add_linear_operator_coord! β Method
add_linear_operator_coord!(
M::AbstractManifold, y::AbstractVector, lmsco::LevenbergMarquardtLinearSurrogateCoordinatesObjective, p, cX::AbstractVector
)Add the (Triggs correction, residual-like) linear operator corresponding to the lmsco surrogate to vector y. It is assumed that lmsco.value_cache has been filled in step_solver! of LevenbergMarquardt, so we can just use it here.
Manopt.add_normal_linear_operator! β Method
add_normal_linear_operator!(
M::AbstractManifold, A::AbstractMatrix, o::AbstractFirstOrderVectorFunction,
r::AbstractRobustifierFunction, p, basis::AbstractBasis;
value_cache = get_value(M, o, p), Ξ΅::Real, mode::Symbol
)Add the contribution of a single block (vectorial function with its robustifier) to the linear normal operator, i.e. compute $A += J_F^*(p)[C^T C J_F(p)[X]]$ in-place of A for the given block. See get_normal_linear_operator for details
Manopt.add_normal_vector_field! β Method
add_normal_vector_field!(M::AbstractManifold, X, o::AbstractFirstOrderVectorFunction, r::AbstractRobustifierFunction, p)
add_normal_vector_field!(M::AbstractManifold, c, o::AbstractFirstOrderVectorFunction, r::AbstractRobustifierFunction, p, B::AbstractBasis)Add the contribution of o / r to the normal linear operator tangent vector in X or c. See get_normal_vector_field for the mathematical details. Note that this is done per every block (vectorial function with its robustifier) of the underlying ManifoldNonlinearLeastSquaresObjective and summed up.
See also get_normal_linear_operator for evaluating the corresponding linear operator of the (normal) linear system, and get_LevenbergMarquardt_scaling for details on the scaling and computation of $C$.
Manopt.get_LevenbergMarquardt_scaling β Function
residual_scaling, operator_scaling = get_LevenbergMarquardt_scaling(Ο_prime::Real, Ο_double_prime::Real, FkSq::Real, threshold::Real=1.0e-5, mode::Symbol=:Strict)Compute the scalings for the residual $y$ and within the operator $C$ that are required for the robust rescaling within LevenbergMarquardts get_vector_field and get_linear_operator, respectively. Here FkSq denotes $s = \lVert F(p) \rVert_{2}^2$ of the residual vector function $F$ evaluated at some point $p$, and Ο_prime $= Ο'(s)$ and Ο_double_prime $= Ο''(s)$ denote the current AbstractRobustifierFunction's first and second derivative evaluated at $s$.
The value for $Ξ±$ is given by
\[ Ξ± = 1 - \sqrt{1 + 2\frac{Ο''(s)}{Ο'(s)}s}\]
and hence the scaling of the residual and the one within the projection of the operator are
\[\frac{\sqrt{Ο'(s)}}{1-Ξ±} \qquad\text{ and }\qquad \begin{cases} \frac{Ξ±}{s} & \text{ if } s β 0\\\\ 0 & \text{ else,}\end{cases}\]
respectively.
Numerical stability
For a unique solution that is a minimizer in a Levenberg-Marquardt step, we require Ξ± < 1 and [TMHF00] recommends to bound this even by $1-Ξ΅$ for some threshold $Ξ΅ > 0$.
Furthermore if $Ο'(s) + 2Ο''(s)β s β€ 0$ the Hessian is also indefinite. This can be caught by making sure the argument of the $β$ is ensured to be non-negative.
The Ceres solver even omits the second term in the square root already if $Ο(s)'' < 0$ for stability reason, which means setting $Ξ± = 0$. In the case $s = 0$ we also set the operator scaling $Ξ± / s = 0$.
This function offers two modes
:Normalkeeps negative $Ο''(s) < 0$ but makes sure the square root is well-defined.:Strict(default) sets $Ξ± = 0$ when $Ο''(s) < 0$ or when $s = 0$.
Manopt.get_linear_operator! β Method
get_linear_operator(M::AbstractManifold, neo::NormalEquationsObjective, p, X)
get_linear_operator(M::AbstractManifold, neo::NormalEquationsObjective, p, c, B)
get_linear_operator(M::AbstractManifold, neo::NormalEquationsObjective, p, B)
get_linear_operator!(M::AbstractManifold, Y, neo::NormalEquationsObjective, p, X)
get_linear_operator!(M::AbstractManifold, b, neo::NormalEquationsObjective, p, c, B)
get_linear_operator!(M::AbstractManifold, A, neo::NormalEquationsObjective, p, B)Evaluate the linear operator related to the normal equations of the LevenbergMarquardtLinearSurrogateObjective. See get_normal_linear_operator for details.
Manopt.get_linear_operator! β Method
get_linear_operator(M::AbstractManifold, neo::NormalEquationsObjective, p, X)
get_linear_operator(M::AbstractManifold, neo::NormalEquationsObjective, p, c, B)
get_linear_operator(M::AbstractManifold, neo::NormalEquationsObjective, p, B)
get_linear_operator!(M::AbstractManifold, Y, neo::NormalEquationsObjective, p, X)
get_linear_operator!(M::AbstractManifold, b, neo::NormalEquationsObjective, p, c, B)
get_linear_operator!(M::AbstractManifold, A, neo::NormalEquationsObjective, p, B)Evaluate the linear operator related to the normal equations of the LevenbergMarquardtLinearSurrogateObjective. See get_normal_linear_operator for details.
Manopt.get_linear_operator! β Method
get_linear_operator(M::AbstractManifold, neo::NormalEquationsObjective, p, X)
get_linear_operator(M::AbstractManifold, neo::NormalEquationsObjective, p, c, B)
get_linear_operator(M::AbstractManifold, neo::NormalEquationsObjective, p, B)
get_linear_operator!(M::AbstractManifold, Y, neo::NormalEquationsObjective, p, X)
get_linear_operator!(M::AbstractManifold, b, neo::NormalEquationsObjective, p, c, B)
get_linear_operator!(M::AbstractManifold, A, neo::NormalEquationsObjective, p, B)Evaluate the linear operator related to the normal equations of the LevenbergMarquardtLinearSurrogateObjective. See get_normal_linear_operator for details.
Manopt.get_linear_operator β Method
get_linear_operator(M::AbstractManifold, lmsco::LevenbergMarquardtLinearSurrogateObjective, p, X)
get_linear_operator!(M::AbstractManifold, y, lmsco::LevenbergMarquardtLinearSurrogateObjective, p, X)Evaluate the linear operator $\mathcal{L}$ corresponding to the Levenberg-Marquardt surrogate objective, i.e.,
\[\mathcal{L}(X) = C J_F(p)[X] \bigr],\]
with
\[C = \sqrt{Ο'(p)}(I-Ξ±P), \qquad P = \frac{F(p)F(p)^\mathrm{T}}{\lVert F(p) \rVert_{2}^2},\]
where $Ξ± = 1 - \sqrt{1 + 2 \frac{Ο''(p)}{Ο'(p)}\lVert F(p) \rVert_{2}^2}$.
Note that this is done per every block (vectorial function with its robustifier) of the underlying ManifoldNonlinearLeastSquaresObjective and summed up.
This can be computed in-place of y.
See also get_vector_field for evaluating the corresponding vector field
Manopt.get_linear_operator β Method
get_linear_operator(M::AbstractManifold, neo::NormalEquationsObjective, p, X)
get_linear_operator(M::AbstractManifold, neo::NormalEquationsObjective, p, c, B)
get_linear_operator(M::AbstractManifold, neo::NormalEquationsObjective, p, B)
get_linear_operator!(M::AbstractManifold, Y, neo::NormalEquationsObjective, p, X)
get_linear_operator!(M::AbstractManifold, b, neo::NormalEquationsObjective, p, c, B)
get_linear_operator!(M::AbstractManifold, A, neo::NormalEquationsObjective, p, B)Evaluate the linear operator related to the normal equations of the LevenbergMarquardtLinearSurrogateObjective. See get_normal_linear_operator for details.
Manopt.get_linear_operator β Method
get_linear_operator(M::AbstractManifold, neo::NormalEquationsObjective, p, X)
get_linear_operator(M::AbstractManifold, neo::NormalEquationsObjective, p, c, B)
get_linear_operator(M::AbstractManifold, neo::NormalEquationsObjective, p, B)
get_linear_operator!(M::AbstractManifold, Y, neo::NormalEquationsObjective, p, X)
get_linear_operator!(M::AbstractManifold, b, neo::NormalEquationsObjective, p, c, B)
get_linear_operator!(M::AbstractManifold, A, neo::NormalEquationsObjective, p, B)Evaluate the linear operator related to the normal equations of the LevenbergMarquardtLinearSurrogateObjective. See get_normal_linear_operator for details.
Manopt.get_normal_linear_operator β Method
get_normal_linear_operator(M::AbstractManifold, lmsco::LevenbergMarquardtLinearSurrogateObjective, p, X; threshold = lmsco.threshold, mode = lmsco.mode, penalty = lmsco.penalty)
get_normal_linear_operator!(M::AbstractManifold, Y, lmsco::LevenbergMarquardtLinearSurrogateObjective, p, X; threshold = lmsco.threshold, mode = lmsco.mode, penalty = lmsco.penalty)
get_normal_linear_operator(M::AbstractManifold, lmsco::LevenbergMarquardtLinearSurrogateObjective, p[, c], B::AbstractBasis; threshold = lmsco.threshold, mode = lmsco.mode, penalty = lmsco.penalty)
get_normal_linear_operator!(M::AbstractManifold, [A | b], lmsco::LevenbergMarquardtLinearSurrogateObjective, p[, c], B::AbstractBasis; threshold = lmsco.threshold, mode = lmsco.mode, penalty = lmsco.penalty)Compute the linear operator $\mathcal{A}$ corresponding to the optimality conditions of the modified Levenberg-Marquardt surrogate objective, i.e. the normal conditions
\[\mathcal{A}(X) = \mathcal{L}^* \mathcal{L}(X) + Ξ»X = J_F^*(p)\bigl[ C^T C J_F(p)[X] \bigr] + Ξ»X,\]
where $Ξ» =$penalty is a damping parameter and with $Ξ± = 1 - \sqrt{1 + 2 \frac{Ο''(p)}{Ο'(p)}\lVert F(p) \rVert_{2}^2}$ we have
\[C = \sqrt{Ο'(p)}(I-Ξ±P), \qquad P = \frac{F(p)F(p)^\mathrm{T}}{\lVert F(p) \rVert_{2}^2},\]
See get_LevenbergMarquardt_scaling for details on the scaling and Ξ±. and get_jacobian and get_adjoint_jacobian concerning $J_F$ and $J_F^*$, respectively.
There are three variants to use this function to use the corresponding linear operator
- if you provide a tangent vector
X, then the linear operator is evaluated atX, the corresponding gradientYis returned - if you provide
Xin coordinatescwith respect to a basisBthe linear operator is evaluated and the coordinatesbof the result are returned - if you provide (just) a basis
Bof the tangent space, then the matrixAof the linear operator represented in this basis is returned. The relation to the second case is that $b = Ac$.
See also get_normal_vector_field for evaluating the corresponding vector field.
Manopt.get_normal_vector_field! β Method
get_normal_vector_field(M::AbstractManifold, lmsco::LevenbergMarquardtLinearSurrogateObjective, p)
get_normal_vector_field!(M::AbstractManifold, X, lmsco::LevenbergMarquardtLinearSurrogateObjective, p)
get_normal_vector_field(M::AbstractManifold, lmsco::LevenbergMarquardtLinearSurrogateObjective, p, B::AbstractBasis)
get_normal_vector_field!(M::AbstractManifold, c, lmsco::LevenbergMarquardtLinearSurrogateObjective, p, B::AbstractBasis)Compute the normal linear operator tangent vector $X$ corresponding to the normal equations (optimality conditions) of the Levenberg-Marquardt surrogate objective, i.e.,
\[X = J_F^*(p)[ C^T y], \quad y = \frac{\sqrt{Ο'(p)}}{1-Ξ±}F(p).\]
If you provide an AbstractBasis B $=\{Z_1,β¦,Z_d\}$ additionally, the result will be given in coordinates c, i.e. such that $X = \sum_{i=1}^{d} c_iZ_i$.
Note that this is done per every block (vectorial function with its robustifier) of the underlying ManifoldNonlinearLeastSquaresObjective and summed up. See also get_normal_linear_operator for evaluating the corresponding linear operator of the (normal) linear system, and get_LevenbergMarquardt_scaling for details on the scaling and computation of $C$.
Manopt.get_normal_vector_field! β Method
get_normal_vector_field(M::AbstractManifold, lmsco::LevenbergMarquardtLinearSurrogateObjective, p)
get_normal_vector_field!(M::AbstractManifold, X, lmsco::LevenbergMarquardtLinearSurrogateObjective, p)
get_normal_vector_field(M::AbstractManifold, lmsco::LevenbergMarquardtLinearSurrogateObjective, p, B::AbstractBasis)
get_normal_vector_field!(M::AbstractManifold, c, lmsco::LevenbergMarquardtLinearSurrogateObjective, p, B::AbstractBasis)Compute the normal linear operator tangent vector $X$ corresponding to the normal equations (optimality conditions) of the Levenberg-Marquardt surrogate objective, i.e.,
\[X = J_F^*(p)[ C^T y], \quad y = \frac{\sqrt{Ο'(p)}}{1-Ξ±}F(p).\]
If you provide an AbstractBasis B $=\{Z_1,β¦,Z_d\}$ additionally, the result will be given in coordinates c, i.e. such that $X = \sum_{i=1}^{d} c_iZ_i$.
Note that this is done per every block (vectorial function with its robustifier) of the underlying ManifoldNonlinearLeastSquaresObjective and summed up. See also get_normal_linear_operator for evaluating the corresponding linear operator of the (normal) linear system, and get_LevenbergMarquardt_scaling for details on the scaling and computation of $C$.
Manopt.get_normal_vector_field β Method
get_normal_vector_field(M::AbstractManifold, lmsco::LevenbergMarquardtLinearSurrogateObjective, p)
get_normal_vector_field!(M::AbstractManifold, X, lmsco::LevenbergMarquardtLinearSurrogateObjective, p)
get_normal_vector_field(M::AbstractManifold, lmsco::LevenbergMarquardtLinearSurrogateObjective, p, B::AbstractBasis)
get_normal_vector_field!(M::AbstractManifold, c, lmsco::LevenbergMarquardtLinearSurrogateObjective, p, B::AbstractBasis)Compute the normal linear operator tangent vector $X$ corresponding to the normal equations (optimality conditions) of the Levenberg-Marquardt surrogate objective, i.e.,
\[X = J_F^*(p)[ C^T y], \quad y = \frac{\sqrt{Ο'(p)}}{1-Ξ±}F(p).\]
If you provide an AbstractBasis B $=\{Z_1,β¦,Z_d\}$ additionally, the result will be given in coordinates c, i.e. such that $X = \sum_{i=1}^{d} c_iZ_i$.
Note that this is done per every block (vectorial function with its robustifier) of the underlying ManifoldNonlinearLeastSquaresObjective and summed up. See also get_normal_linear_operator for evaluating the corresponding linear operator of the (normal) linear system, and get_LevenbergMarquardt_scaling for details on the scaling and computation of $C$.
Manopt.get_normal_vector_field β Method
get_normal_vector_field(M::AbstractManifold, lmsco::LevenbergMarquardtLinearSurrogateObjective, p)
get_normal_vector_field!(M::AbstractManifold, X, lmsco::LevenbergMarquardtLinearSurrogateObjective, p)
get_normal_vector_field(M::AbstractManifold, lmsco::LevenbergMarquardtLinearSurrogateObjective, p, B::AbstractBasis)
get_normal_vector_field!(M::AbstractManifold, c, lmsco::LevenbergMarquardtLinearSurrogateObjective, p, B::AbstractBasis)Compute the normal linear operator tangent vector $X$ corresponding to the normal equations (optimality conditions) of the Levenberg-Marquardt surrogate objective, i.e.,
\[X = J_F^*(p)[ C^T y], \quad y = \frac{\sqrt{Ο'(p)}}{1-Ξ±}F(p).\]
If you provide an AbstractBasis B $=\{Z_1,β¦,Z_d\}$ additionally, the result will be given in coordinates c, i.e. such that $X = \sum_{i=1}^{d} c_iZ_i$.
Note that this is done per every block (vectorial function with its robustifier) of the underlying ManifoldNonlinearLeastSquaresObjective and summed up. See also get_normal_linear_operator for evaluating the corresponding linear operator of the (normal) linear system, and get_LevenbergMarquardt_scaling for details on the scaling and computation of $C$.
Manopt.get_vector_field! β Method
get_vector_field(M::AbstractManifold, neo::NormalEquationsObjective, p)
get_vector_field(M::AbstractManifold, neo::NormalEquationsObjective, p, B)
get_vector_field!(M::AbstractManifold, Y, neo::NormalEquationsObjective, p)
get_vector_field!(M::AbstractManifold, c, neo::NormalEquationsObjective, p, B)Evaluate the vector field related to the normal equations of the LevenbergMarquardtLinearSurrogateObjective. See get_normal_vector_field for details, but note that for the NormalEquationsObjective the format is slightly different: For the variant with _normal the result is similar to the surrogate, namely we have $\mathcal{L}(X) + y$ for the surrogate and hence also the same form $\mathcal{N}(X) + z$, which has to be set to zero to find $X$.
For the objective here we consider ``$\mathcal{N}(X) = z'$, i.e. the get_vector_field z' = -z` differs by a sign.
Manopt.get_vector_field! β Method
get_vector_field(M::AbstractManifold, neo::NormalEquationsObjective, p)
get_vector_field(M::AbstractManifold, neo::NormalEquationsObjective, p, B)
get_vector_field!(M::AbstractManifold, Y, neo::NormalEquationsObjective, p)
get_vector_field!(M::AbstractManifold, c, neo::NormalEquationsObjective, p, B)Evaluate the vector field related to the normal equations of the LevenbergMarquardtLinearSurrogateObjective. See get_normal_vector_field for details, but note that for the NormalEquationsObjective the format is slightly different: For the variant with _normal the result is similar to the surrogate, namely we have $\mathcal{L}(X) + y$ for the surrogate and hence also the same form $\mathcal{N}(X) + z$, which has to be set to zero to find $X$.
For the objective here we consider ``$\mathcal{N}(X) = z'$, i.e. the get_vector_field z' = -z` differs by a sign.
Manopt.get_vector_field β Method
get_vector_field(M::AbstractManifold, lmsco::LevenbergMarquardtLinearSurrogateObjective, p)
get_vector_field!(M::AbstractManifold, X, lmsco::LevenbergMarquardtLinearSurrogateObjective, p)Compute the vector field $y$ corresponding to the Levenberg-Marquardt surrogate objective, i.e.,
\[y = \frac{\sqrt{Ο'(p)}}{1-Ξ±}F(p)\]
where the scaling uses $Ξ± = 1 - \sqrt{1 + 2 \frac{Ο''(p)}{Ο'(p)}\lVert F(p) \rVert_{2}^2}$
Note that this is done per every block (vectorial function with its robustifier) of the underlying ManifoldNonlinearLeastSquaresObjective and summed up.
See also
get_LevenbergMarquardt_scalingfor details on the scaling factorget_linear_operatorfor evaluating the corresponding linear operator of the linear system
Manopt.get_vector_field β Method
get_vector_field(M::AbstractManifold, neo::NormalEquationsObjective, p)
get_vector_field(M::AbstractManifold, neo::NormalEquationsObjective, p, B)
get_vector_field!(M::AbstractManifold, Y, neo::NormalEquationsObjective, p)
get_vector_field!(M::AbstractManifold, c, neo::NormalEquationsObjective, p, B)Evaluate the vector field related to the normal equations of the LevenbergMarquardtLinearSurrogateObjective. See get_normal_vector_field for details, but note that for the NormalEquationsObjective the format is slightly different: For the variant with _normal the result is similar to the surrogate, namely we have $\mathcal{L}(X) + y$ for the surrogate and hence also the same form $\mathcal{N}(X) + z$, which has to be set to zero to find $X$.
For the objective here we consider ``$\mathcal{N}(X) = z'$, i.e. the get_vector_field z' = -z` differs by a sign.
Manopt.get_vector_field β Method
get_vector_field(M::AbstractManifold, neo::NormalEquationsObjective, p)
get_vector_field(M::AbstractManifold, neo::NormalEquationsObjective, p, B)
get_vector_field!(M::AbstractManifold, Y, neo::NormalEquationsObjective, p)
get_vector_field!(M::AbstractManifold, c, neo::NormalEquationsObjective, p, B)Evaluate the vector field related to the normal equations of the LevenbergMarquardtLinearSurrogateObjective. See get_normal_vector_field for details, but note that for the NormalEquationsObjective the format is slightly different: For the variant with _normal the result is similar to the surrogate, namely we have $\mathcal{L}(X) + y$ for the surrogate and hence also the same form $\mathcal{N}(X) + z$, which has to be set to zero to find $X$.
For the objective here we consider ``$\mathcal{N}(X) = z'$, i.e. the get_vector_field z' = -z` differs by a sign.
- 1This cache requires
LRUCache.jlto be loaded as well.