apg: Accelerated proximal gradient optimization

Description Usage Arguments Value Examples

Description

This function implements an accelerated proximal gradient method (Nesterov 2007, Beck and Teboulle 2009). It solves:

min_x (f(x) + h(x)), x \in R^dim_x

where f is smooth, convex and h is non-smooth, convex but simple in that we can easily evaluate the proximal operator of h.

Usage

1
apg(grad_f, prox_h, dim_x, opts)

Arguments

grad_f

A function that computes the gradient of f : grad_f(v,opts) = df(v)/dv

prox_h

A function that computes the proximal operator of h : prox_h(v,t,opts) = argmin_x (t*h(x) + 1/2 * norm(x-v)^2)

dim_x

The dimension of the unknown x

opts

List of parameters, both for the apg function and for the grad_f and prox_h functions. For apg, the list can contain the following fields:

  • X_INIT: initial starting point (default 0)

  • USE_RESTART : use adaptive restart scheme (default TRUE)

  • MAX_ITERS : maximum iterations before termination (default 2000)

  • EPS : tolerance for termination (default 1e-6)

  • ALPHA : step-size growth factor (default 1.01)

  • BETA : step-size shrinkage factor (default 0.5)

  • QUIET : if false writes out information every 100 iters (default FALSE)

  • GEN_PLOTS : if true generates plots of norm of proximal gradient (default TRUE)

  • USE_GRA : if true uses UN-accelerated proximal gradient descent (typically slower) (default FALSE)

  • STEP_SIZE : starting step-size estimate, if not set then apg makes initial guess (default NULL)

  • FIXED_STEP_SIZE : don't change step-size (forward or back tracking), uses initial step-size throughout, only useful if good STEP_SIZE set (default FALSE)

In addition, opts can contain other fields that will be passed to the grad_f and prox_h functions. This code was borrowed and adapted from the MATLAB version of Brendan O'Donoghue available at https://github.com/bodono/apg

Value

A list with x, the solution of the problem:

min_x (f(x) + h(x)), x \in R^dim_x ,

and t, the last step size.

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
# Solve a Lasso problem:
# min_x 1/2 norm( A%*%x - b )^2 + lambda ||x||_1
n <- 50
m <- 20
lambda <- 1
A <- matrix(rnorm(m*n), nrow=n)
b <- rnorm(n)
r <- apg(grad.quad, prox.l1, m, list(A=A, b=b, lambda=lambda) )
# This gives the same result as:
# m <- glmnet(A,b,alpha=1, standardize=FALSE,lambda=1/50,intercept=FALSE)

jpvert/apg documentation built on May 19, 2019, 11:51 p.m.