Skip to contents

Manopt gathers the parts of Manopt.jl that OptimizationManopt re-exports, ported to R: the solvers on a manifold M (Euclidean(), Sphere(), SymmetricPositiveDefinite() or Lorentz()), called with the cost f(M, p) and, where needed, the Riemannian gradient grad_f(M, p) and Hessian Hess_f(M, p, X) (approximated by finite differences of the gradient when missing; as in Julia the point may then follow grad_f directly, trust_regions(M, f, grad_f, p)), the stopping criteria and the step sizes. Reach them with Manopt$name.

Usage

Manopt

Format

A list of functions.

Details

Solvers: gradient_descent(M, f, grad_f, p, ...), conjugate_gradient_descent(M, f, grad_f, p, ...), quasi_Newton(M, f, grad_f, p, ...), trust_regions(M, f, grad_f, Hess_f, p, ...), adaptive_regularization_with_cubics(M, f, grad_f, Hess_f, p, ...), Frank_Wolfe_method(M, f, grad_f, p, ...), NelderMead(M, f, population, ...), particle_swarm(M, f, swarm, ...), cma_es(M, f, p, ...) and convex_bundle_method(M, f, subgrad_f, p, ...). Each returns the final point, or with return_state = TRUE a state whose p is that point and stopped_by the criterion that stopped it; get_solver_result(state) returns the point. Keyword arguments include stopping_criterion, stepsize, retraction_method and vector_transport_method.

Stopping criteria: StopAfterIteration(n), StopAfter(seconds), StopWhenGradientNormLess(tol), StopWhenChangeLess(tol), StopWhenStepsizeLess(tol), StopWhenCostLess(tol), StopWhenPopulationConcentrated(tol_f, tol_p), StopWhenSwarmVelocityLess(tol), StopWhenLagrangeMultiplierLess(tol) and StopWhenAny(...), which stops when any of its criteria does.

Step sizes: ArmijoLinesearch(...), WolfePowellLinesearch(...), DecreasingStepsize(...) and ConstantLength(...). Retractions and transports: ExponentialRetraction(), ProjectionRetraction(), ParallelTransport() and ProjectionTransport().

Examples

M <- Sphere(2)
A <- diag(c(2, 1, 3))
f <- function(M, p) sum(p * (A %*% p))
grad_f <- function(M, p) { g <- 2 * as.numeric(A %*% p); g - sum(p * g) * p }
p <- Manopt$gradient_descent(M, f, grad_f, c(1, 1, 1) / sqrt(3),
                             stopping_criterion = Manopt$StopAfterIteration(50))
round(abs(p), 6)
#> [1] 0e+00 1e+00 1e-06