Docsity

Parameter Optimization: Linear and Online | CS 8803, Study notes of Computer Science

Partial preview of the text

Download Parameter Optimization: Linear and Online | CS 8803 and more Study notes Computer Science in PDF only on Docsity!

CS 8803-MDM Lecture 25

Parameter Optimization IV: Linear and Online

Alexander Gray [email protected] Georgia Institute of Technology CS 8803-MDM Lecture 25 – p.1/

Today

1. Linear Algebraic Optimization2. Online Convex Optimization

CS 8803-MDM Lecture 25 – p.2/

Types of Matrices

There are several special cases of matrices for which thereare often faster custom methods:

banded (diagonal, tridiagonal, triangular, Hessenberg...) block symmetric (

A

T

A

definite (positive, semi-) Vandermonde Toeplitz

Mostly, these allow different matrix decompositions, whichlead to different types of solutions.

CS 8803-MDM Lecture 25 – p.4/

Types of Matrices

These lead to implicit storage, and matrix multiplication:

sparse kernel

Examples:

Covariance matrices: symmetric positive definite,sometimes diagonal. AR models: Toeplitz. Kernel PCA: kernel matrix, or sparse.

CS 8803-MDM Lecture 25 – p.5/

Least Squares Problem

This has the form

min x

Ax

b

2

(5)

In linear algebra this is the standard linear

least-squares

problem

This is basically solving

Ax

b

when the system is

overdetermined

(more equations than unknowns). It can be

put in the form of

A

′ x

b ′^

with square

A

′^

as

A

T

A

x

A

T b, (6)

called the

normal equations

of the least-squares problem.

CS 8803-MDM Lecture 25 – p.7/

Optimization Form

Consider the linear system

Ax

b

. Assume for the moment

that

A

is symmetric and positive definite (thus square). Let’s

consider the best solution to the quadratic form

φ

x

x T Ax

x T b. (7)

Then the minimizer

x ∗

is exactly the solution to

Ax

b

CS 8803-MDM Lecture 25 – p.8/

Optimization Form

More simply, looking at the derivative we find that

φ

Ax

b. (11)

Clearly the only point at which the gradient is zero is thesolution of

Ax

b

. So the problem

Ax

b

can be written as

the optimization problem

φ

x

1 2 x T Ax

x T b

CS 8803-MDM Lecture 25 – p.10/

Steepest Descent

At the current guess

x k

, the function

φ

decreases most

rapidly in the direction of the negative gradient: −∇

φ

x k

b

Ax k

. If the

residual

r k

b

Ax k (12)

of

x k

is nonzero, there exists a positive

α

such that

φ

x k

α k r k

< φ

x k

The residual gives us our search direction,

p k

r k

. Now we

need the step size

α k

; determining it is called

line search

CS 8803-MDM Lecture 25 – p.11/

Conjugate Gradient

It turns out that this isn’t that efficient. Taking the steepestdirection from

x k

is not the same as taking the direction

which goes to the bottom of a long trough with steep sides,say. We will do a smoothing of the directions over the iterations,by using

p k

r k − 1

β k p k − 1 (15)

where

β k

r k

, r k

r k , r k

(16)

This is called

conjugate gradient

. We won’t go into its theory.

CS 8803-MDM Lecture 25 – p.13/

Conjugate Gradient

What’s good about this:

Inside each iteration, we need only perform amultiplication of the matrix

A

with a different vector each

time. We do not need to make a new matrix the size of A

. This is good if

A

is large.

It turns out this hones in quickly on the top eigenvalues.

It is the method of choice for large, sparse matrices.

CS 8803-MDM Lecture 25 – p.14/

Decomposition-based Methods

The downside of the Krylov-type approaches, also called iterative methods

, is that their numerical stability is not the

best possible.For full-rank matrices, the methods of choice are

Gaussian

elimination

or orthogonalization approaches such as

QR

factorization

For rank-deficient or unknown-rank matrices, the method ofchoice is

singular value decomposition

CS 8803-MDM Lecture 25 – p.16/

Online OptimizationProblems One data point at a time.

CS 8803-MDM Lecture 25 – p.17/

Sherman-Morrison Formula

The

Sherman-Morrison

formula gives the inverse after the

change

A

u

v

− 1

A

− 1

A

− 1 u

vA − 1

vA − 1 u

(18)

The advantage of this is that it only requires two matrixmultiplications and a dot product, which is

O
N

(^2)

rather

than

O
N

(^3)

to redo the entire inverse.

This can be used for obtaining

A

u

v

x

b (19)

in an online fashion.

CS 8803-MDM Lecture 25 – p.19/

Stochastic Gradient Descent

Consider the batch optimization problem

arg min w

1 N

N ∑^ i = φ

w T x i , y i

λ^2

w

2 2

(20)

where

φ

is convex.

Stochastic gradient descent

updates the

parameters one datum at a time via

̂ w k

w k − 1

α k

λ ̂ w k − 1

φ ′

̂ w T k − 1 x k , y k

x k

(21)

where

φ ′^

∂ ∂w φ

CS 8803-MDM Lecture 25 – p.20/