orthopen: Solver for a general problem of the form: min (loss +... In kevinVervier/orthopen: Learning Matrices with Orthogonal Columns or Disjoint Supports

Description

`orthopen`

Usage

 ```1 2 3``` ```orthopen(X, Y, lambda = 1, step_size = 0.1, verbose = 0, stop_no_improve = 100, max_iter = 1e+06, K = NULL, disjoint = TRUE, logistic = FALSE, enet = FALSE) ```

Arguments

 `X` MxP observations matrix (features are in columns) `Y` MxT observed output matrix for T different tasks `lambda` a regularization parameter (default `1`) `step_size` step for gradient descent (default `0.1`) `verbose` option (default `0`) `stop_no_improve` number of gradient descent steps without improvment before stopping (default: `100`) `max_iter` maximum number of iterations before stopping optimization (default: `1000000`) `K` PxP orthogonality constraints matrix (default: diagonal matrix –> no orthogonality constraint) `disjoint` if `TRUE` add contraints for disjoint supports (default: TRUE) `logistic` if `TRUE` change loss function to logistic loss (for classification problems) `enet` if `TRUE`, add a `L1` penalization to the `L2` penalization, using elastic net formula (single parameter lambda, assuming enet = 0.5*L2 + 0.5*L1)

Value

a list containing three elements

• `W`: optimal PxT matrix for objective function minimum

• obj: objective function value at W

• imax: number of steps before reaching optimum

Examples

 ``` 1 2 3 4 5 6 7 8 9 10 11 12 13``` ```#solve orthogonal columns problem # min_W 1/2 norm( X%*%W - Y )^2 + lambda ||W||_orthopen NVAR=10 NTRAIN=100 T=3 K = matrix(1,nrow=T,ncol=T) # Generate random data and random model X <- matrix(rnorm(NTRAIN*NVAR),nrow=NTRAIN,ncol=NVAR) # Random orthogonal matrix W <- qr.Q(qr(matrix(rnorm(NVAR*T),nrow=NVAR,ncol=T))) Y <- X %*% W + matrix(rnorm(NTRAIN*T),nrow=NTRAIN) set.seed(42) res <- orthopen(X,Y,lambda = 0.1,K = K,disjoint = FALSE) ```

kevinVervier/orthopen documentation built on May 20, 2019, 9:07 a.m.