Linear Minimization Oracles
The Linear Minimization Oracle (LMO) is a key component called at each iteration of the FW algorithm. Given $d\in \mathcal{X}$, it returns a vertex of the feasible set:
\[v\in \argmin_{x\in \mathcal{C}} \langle d,x \rangle.\]
See Combettes, Pokutta 2021 for references on most LMOs implemented in the package and their comparison with projection operators.
Interface and wrappers
FrankWolfe.LinearMinimizationOracle
— TypeSupertype for linear minimization oracles.
All LMOs must implement compute_extreme_point(lmo::LMO, direction)
and return a vector v
of the appropriate type.
All of them are subtypes of FrankWolfe.LinearMinimizationOracle
and implement the following method:
FrankWolfe.compute_extreme_point
— Functioncompute_extreme_point(lmo::LinearMinimizationOracle, direction; kwargs...)
Computes the point argmin_{v ∈ C} v ⋅ direction
with C
the set represented by the LMO. Most LMOs feature v
as a keyword argument that allows for an in-place computation whenever v
is dense. All LMOs should accept keyword arguments that they can ignore.
We also provide some meta-LMOs wrapping another one with extended behavior:
FrankWolfe.CachedLinearMinimizationOracle
— TypeCachedLinearMinimizationOracle{LMO}
Oracle wrapping another one of type lmo. Subtypes of CachedLinearMinimizationOracle
contain a cache of previous solutions.
By convention, the inner oracle is named inner
. Cached optimizers are expected to implement Base.empty!
and Base.length
.
FrankWolfe.ProductLMO
— TypeProductLMO(lmos)
Linear minimization oracle over the Cartesian product of multiple LMOs.
FrankWolfe.SingleLastCachedLMO
— TypeSingleLastCachedLMO{LMO, VT}
Caches only the last result from an LMO and stores it in last_vertex
. Vertices of LMO
have to be of type VT
if provided.
FrankWolfe.MultiCacheLMO
— TypeMultiCacheLMO{N, LMO, A}
Cache for a LMO storing up to N
vertices in the cache, removed in FIFO style. oldest_idx
keeps track of the oldest index in the tuple, i.e. to replace next. VT
, if provided, must be the type of vertices returned by LMO
FrankWolfe.VectorCacheLMO
— TypeVectorCacheLMO{LMO, VT}
Cache for a LMO storing an unbounded number of vertices of type VT
in the cache. VT
, if provided, must be the type of vertices returned by LMO
Norm balls
FrankWolfe.EllipsoidLMO
— TypeEllipsoidLMO(A, c, r)
Linear minimization over an ellipsoid centered at c
of radius r
:
x: (x - c)^T A (x - c) ≤ r
The LMO stores the factorization F
of A that is used to solve linear systems A⁻¹ x
. The result of the linear system solve is stored in buffer
. The ellipsoid is assumed to be full-dimensional -> A is positive definite.
FrankWolfe.KNormBallLMO
— TypeKNormBallLMO{T}(K::Int, right_hand_side::T)
LMO with feasible set being the K-norm ball in the sense of 2010.07243, i.e., the convex hull over the union of an L1-ball with radius τ and an L∞-ball with radius τ/K:
C_{K,τ} = conv { B_1(τ) ∪ B_∞(τ / K) }
with τ
the right_hand_side
parameter. The K-norm is defined as the sum of the largest K
absolute entries in a vector.
FrankWolfe.LpNormLMO
— TypeLpNormLMO{T, p}(right_hand_side)
LMO with feasible set being an L-p norm ball:
C = {x ∈ R^n, norm(x, p) ≤ right_hand_side}
FrankWolfe.NuclearNormLMO
— TypeNuclearNormLMO{T}(radius)
LMO over matrices that have a nuclear norm less than radius
. The LMO returns the best rank-one approximation matrix with singular value radius
, computed with Arpack.
FrankWolfe.OrderWeightNormLMO
— TypeOrderWeightNormLMO(weights,radius)
LMO with feasible set being the atomic ordered weighted l1 norm: https://arxiv.org/pdf/1409.4271
C = {x ∈ R^n, Ω_w(x) ≤ R}
The weights are assumed to be positive.
FrankWolfe.SpectraplexLMO
— TypeSpectraplexLMO{T,M}(radius::T,gradient_container::M,ensure_symmetry::Bool=true)
Feasible set
{X ∈ 𝕊_n^+, trace(X) == radius}
gradient_container
is used to store the symmetrized negative direction. ensure_symmetry
indicates whether the linear function is made symmetric before computing the eigenvector.
FrankWolfe.UnitSpectrahedronLMO
— TypeUnitSpectrahedronLMO{T,M}(radius::T, gradient_container::M)
Feasible set of PSD matrices with bounded trace:
{X ∈ 𝕊_n^+, trace(X) ≤ radius}
gradient_container
is used to store the symmetrized negative direction. ensure_symmetry
indicates whether the linear function is made symmetric before computing the eigenvector.
Simplex
FrankWolfe.HyperSimplexOracle
— TypeHyperSimplexOracle(radius)
Represents the scaled hypersimplex of radius τ, the convex hull of vectors v
such that:
- v_i ∈ {0, τ}
- ||v||_0 = k
Equivalently, this is the convex hull of the vertices of the K-sparse polytope lying in the nonnegative orthant.
FrankWolfe.ProbabilitySimplexOracle
— TypeProbabilitySimplexOracle(right_side)
Represents the scaled probability simplex:
C = {x ∈ R^n_+, ∑x = right_side}
FrankWolfe.UnitHyperSimplexOracle
— TypeUnitHyperSimplexOracle(radius)
Represents the scaled unit hypersimplex of radius τ, the convex hull of vectors v
such that:
- v_i ∈ {0, τ}
- ||v||_0 ≤ k
Equivalently, this is the intersection of the K-sparse polytope and the nonnegative orthant.
FrankWolfe.UnitSimplexOracle
— TypeUnitSimplexOracle(right_side)
Represents the scaled unit simplex:
C = {x ∈ R^n_+, ∑x ≤ right_side}
FrankWolfe.compute_dual_solution
— MethodDual costs for a given primal solution to form a primal dual pair for scaled probability simplex. Returns two vectors. The first one is the dual costs associated with the constraints and the second is the reduced costs for the variables.
FrankWolfe.compute_dual_solution
— MethodDual costs for a given primal solution to form a primal dual pair for scaled unit simplex. Returns two vectors. The first one is the dual costs associated with the constraints and the second is the reduced costs for the variables.
FrankWolfe.compute_extreme_point
— MethodLMO for scaled probability simplex. Returns a vector with one active value equal to RHS in the most improving (or least degrading) direction.
FrankWolfe.compute_extreme_point
— MethodLMO for scaled unit simplex: ∑ x_i ≤ τ
Returns either vector of zeros or vector with one active value equal to RHS if there exists an improving direction.
Polytope
FrankWolfe.BirkhoffPolytopeLMO
— TypeBirkhoffPolytopeLMO
The Birkhoff polytope encodes doubly stochastic matrices. Its extreme vertices are all permutation matrices of side-dimension dimension
.
FrankWolfe.ConvexHullOracle
— TypeConvexHullOracle{AT,VT}
Convex hull of a finite number of vertices of type AT
, stored in a vector of type VT
.
FrankWolfe.KSparseLMO
— TypeKSparseLMO{T}(K::Int, right_hand_side::T)
LMO for the K-sparse polytope:
C = B_1(τK) ∩ B_∞(τ)
with τ
the right_hand_side
parameter. The LMO results in a vector with the K largest absolute values of direction, taking values -τ sign(x_i)
.
FrankWolfe.ScaledBoundL1NormBall
— TypeScaledBoundL1NormBall(lower_bounds, upper_bounds)
Polytope similar to a L1-ball with shifted bounds. It is the convex hull of two scaled and shifted unit vectors for each axis (shifted to the center of the polytope, i.e., the elementwise midpoint of the bounds). Lower and upper bounds are passed on as abstract vectors, possibly of different types. For the standard L1-ball, all lower and upper bounds would be -1 and 1.
FrankWolfe.ScaledBoundLInfNormBall
— TypeScaledBoundLInfNormBall(lower_bounds, upper_bounds)
Polytope similar to a L-inf-ball with shifted bounds or general box constraints. Lower- and upper-bounds are passed on as abstract vectors, possibly of different types. For the standard L-inf ball, all lower- and upper-bounds would be -1 and 1.
FrankWolfe.ZeroOneHypercube
— TypeZeroOneHypercube
{0,1} hypercube polytope.
MathOptInterface
FrankWolfe.MathOptLMO
— TypeMathOptLMO{OT <: MOI.AbstractOptimizer} <: LinearMinimizationOracle
Linear minimization oracle with feasible space defined through a MathOptInterface.Optimizer. The oracle call sets the direction and reruns the optimizer.
The direction
vector has to be set in the same order of variables as the MOI.ListOfVariableIndices()
getter.
The Boolean use_modify
determines if the objective incompute_extreme_point
is updated with MOI.modify(o, ::MOI.ObjectiveFunction, ::MOI.ScalarCoefficientChange)
or with MOI.set(o, ::MOI.ObjectiveFunction, f)
. use_modify = true
decreases the runtime and memory allocation for models created as an optimizer object and defined directly with MathOptInterface. use_modify = false
should be used for CachingOptimizers.
FrankWolfe.convert_mathopt
— Functionconvert_mathopt(lmo::LMO, optimizer::OT; kwargs...) -> MathOptLMO{OT}
Converts the given LMO to its equivalent MathOptInterface representation using optimizer
. Must be implemented by LMOs.