Docsity

Advanced Machine Learning & Perception, Exercises of Machine Learning

Partial preview of the text

Download Advanced Machine Learning & Perception and more Exercises Machine Learning in PDF only on Docsity!

Advanced Machine

Learning & Perception

Instructor: Tony Jebara

Topic 1

  • Introduction, researchy course, latest papers
  • Going beyond simple machine learning
  • Perception, strange spaces, images, time, behavior
  • Info, policies, texts, web page
  • Syllabus, Overview, Review
  • Gaussian Distributions
  • Representation & Appearance Based Methods
  • Least Squares, Correlation, Gaussians, Bases
  • Principal Components Analysis and its Shortcomings

Course Web Page

http://www.cs.columbia.edu/~jebara/

http://www.cs.columbia.edu/~jebara/

Some material & announcements will be online

But, many things will be handed out in class such as

photocopies of papers for readings, etc.

Check NEWS link to see deadlines, homework, etc.

Available online, see TA info, etc.

Follow the policies, homework, deadlines, readings

closely please!

Syllabus

Week 1: Introduction, Review of Basic Concepts, Representation Issues, Vector

and Appearance-Based Models, Correlation and Least Squared Error Methods,

Bases, Eigenspace Recognition, Principal Components Analysis

Week 2: Nonlinear Dimensionality Reduction, Manifolds, Kernel PCA, Locally

Linear Embedding, Maximum Variance Unfolding, Minimum Volume Embedding

Week 3: Maximum Entropy, Exponential Families, Maximum Entropy

Discrimination, Large Margin Probability Models

Week 4: Conditional Random Fields and Linear Models, Iterative Scaling and

Majorization

Week 5: Graphical Models, Multi-Class Support Vector Machines, Structured

Support Vector Machines, Cutting Plane Algorithms

Week 6: Kernels and Probabilistic Kernels

Beyond Canned Learning

  • Latest research methods, high dimensions, nonlinearities,

dynamics, manifolds, invariance, unlabeled, feature selection

  • Modeling Images / People / Activity / Time Series / MoCAP

Representation & Vectorization

  • How to represent our data? Images, time series, genes…
  • Vectorization: the poor man’s representation
  • Almost anything can be written as a long vector
  • E.g. image is read lexicographically

RGB of eachpixel is added to a vector

  • Or, a gene sequence can be written

as a binary vector

GATACAC = [0100 0001 1000 0001 0010 0001 0010]
  • For images, this is called “Appearance Based” representation
  • But, we lose many important properties this way
  • We will fix this in later lectures
  • For now, it is an easy way to proceed

→

1

3

0

2

⎡

⎣

⎢ ⎢ ⎢ ⎢ ⎢ ⎢

⎤

⎦

⎥ ⎥ ⎥ ⎥ ⎥ ⎥

Least Squares as Gaussian Model

  • Minimum squared error is equivalent to

maximum likelihood under a Gaussian

  • Can now treat it as a probabilistic problem
  • Trying to find the most likely position (or sub-image)

in search image given the Gaussian model

of the template

  • Define the log of the likelihood as:
  • For a Gaussian probability or likelihood is:

i

= arg min

i ∈ 1 , T

⎡

⎣

⎢

⎤

⎦

⎥

1

2

μ − x

i

2

= arg max

i ∈ 1 , T

⎡

⎣

⎢

⎤

⎦

⎥

log

1

2 π

( )

D /

exp −

1

2

μ − x

i

2

log p x | θ

( )

p x

i

| θ

( )

1

2 π

( )

D /

exp −

1

2

μ − x

i

2

  • Gaussian extend to D-dimensions and have 2 parameters:
    • Mean vector μ vector (translates)
    • Covariance matrix Σ (stretches and rotates)
  • Max and expectation = μ
  • Mean is any real vector, variance is now Σ matrix
  • Covariance matrix is positive semi-definite
  • Covariance matrix is symmetric
  • Need matrix inverse (inv)
  • Need matrix determinant (det)
  • Need matrix trace operator (trace)

Multivariate Gaussian

p x | μ,Σ

( )

1

2 π

( )

D /

Σ

exp −

1

2

x − μ

( )

T

− 1

x − μ

( )

x , μ ∈ ℜ

D

D × D

Max Likelihood Gaussian

∂

∂μ

log

1

2 π ( )

D /

Σ

exp −

1

2

x

i

− μ

( )

T

Σ

− 1

x

i

− μ

( )

⎛

⎝

⎜

⎜

⎜

⎞

⎠

⎟

⎟

⎟

i = 1

N

∑

= 0

∂

∂μ

−

D

2

log 2 π −

1

2

log Σ −

1

2

x

i

− μ

( )

T

Σ

− 1

x

i

− μ

( )

i = 1

N

∑

= 0

x

i

− μ

( )

T

Σ

− 1

i = 1

N

∑

= 0

μ =

1

N

x

i

i = 1

N

∑

  • Max over μ

see Jordan Ch. 12, get sample mean…

  • For Σ need Trace operator:

and several properties:

∂ x

T

x

∂ x

= 2 x

T

tr A

( )

= tr A

T

= A

dd d = 1

D

∑

tr AB

( )

= tr BA

( )

tr BAB

− 1

= tr A

( )

tr xx

T

A

= tr x

T

Ax

= x

T

Ax

Max Likelihood Gaussian

  • Likelihood rewritten in trace notation:
  • Max over A=Σ

use properties:

  • Get sample covariance:

l = −

D

2

log 2 π −

1

2

log Σ −

1

2

x

i

− μ

( )

T

Σ

− 1

x

i

− μ

( )

i = 1

N

∑

= −

ND

2

log 2 π +

N

2

log Σ

− 1

−

1

2

tr x

i

− μ

( )

T

Σ

− 1

x

i

− μ

( )

⎡

⎣

⎢

⎢

⎤

⎦

⎥

⎥

i = 1

N

∑

= −

ND

2

log 2 π +

N

2

log Σ

− 1

−

1

2

tr x

i

− μ

( )

x

i

− μ

( )

T

Σ

− 1

⎡

⎣

⎢

⎢

⎤

⎦

⎥

⎥

i = 1

N

∑

= −

ND

2

log 2 π +

N

2

log A −

1

2

tr x

i

− μ

( )

x

i

− μ

( )

T

A

⎡

⎣

⎢

⎢

⎤

⎦

⎥

⎥

i = 1

N

∑

∂ log A

∂ A

= A

− 1

T

∂ tr BA

⎡

⎣

⎢

⎤

⎦

⎥

∂ A

= B

T

∂ l

∂ A

= − 0 +

N

2

A

− 1

( )

T

−

1

2

x

i

− μ

( )

x

i

− μ

( )

T

⎡

⎣

⎢

⎢

⎤

⎦

⎥

⎥

T

i = 1

N

∑

=

N

2

Σ −

1

2

x

i

− μ

( )

x

i

− μ

( )

T

i = 1

N

∑

∂ l

∂ A

= 0 → Σ =

1

N

x

i

− μ

( )

x

i

− μ

( )

T

i = 1

N

∑

Principal Components Analysis

  • PCA approximates each datapoint as a mean vector plus

steps along eigenvector directions. E.g. c

i

steps along v

  • More generally, PCA uses a set of

eigenvectors M (where M<<D)

  • PCA selects to minimize
  • The optimal directions are eigenvectors of covariance
  • Which directions to keep: highest eigenvalues (variances)

x

x

i

1

( )

x

i

2

( )

⎡

⎣

⎢

⎢

⎢

⎢

⎤

⎦

⎥

⎥

⎥

⎥

≈

μ 1

( )

μ 2

( )

⎡

⎣

⎢

⎢

⎢

⎢

⎤

⎦

⎥

⎥

⎥

⎥

  • c

i

v 1

( )

v 2

( )

⎡

⎣

⎢

⎢

⎢

⎢

⎤

⎦

⎥ ⎥ ⎥ ⎥  x i

≈ x ˆ

i

=

μ + c

ij

v

j j = 1

M

∑

μ, c

ij

,

v

j

x

i

− x ˆ

i

2

i = 1

N

∑

Principal Components Analysis

  • Use eigenvectors, mean & coefficients to approximate data
  • PCA finds eigenvectors by decomposing covariance matrix:
  • Eigenvectors are orthonormal:
  • Eigenvalues are non-negative and non-increasing
  • PCA selects the M eigenvectors with largest eigenvalues
  • Truncating gives an approximate covariance:
  • PCA finds coefficients by:

x

i

≈

μ + c

ij

v

j j = 1

M

∑

Σ = V Λ V

T

= λ

i

v

i

v

i

T

i = 1

D

∑

Σ

11

Σ

12

Σ

13

Σ

12

Σ

22

Σ

23

Σ

13

Σ

23

Σ

33

⎡

⎣

⎢ ⎢ ⎢ ⎢ ⎢ ⎢

⎤

⎦

⎥ ⎥ ⎥ ⎥ ⎥ ⎥

=

v

1

⎡

⎣

⎢

⎤

⎦

⎥

v

2

⎡

⎣

⎢

⎤

⎦

⎥

v

3

⎡

⎣

⎢

⎤

⎦

⎥

⎡

⎣

⎢

⎤

⎦

⎥

λ

1

0 0

0 λ

2

0

0 0 λ

3

⎡

⎣

⎢ ⎢ ⎢ ⎢ ⎢ ⎢

⎤

⎦

⎥ ⎥ ⎥ ⎥ ⎥ ⎥

v

1

⎡

⎣

⎢

⎤

⎦

⎥

v

2

⎡

⎣

⎢

⎤

⎦

⎥

v

3

⎡

⎣

⎢

⎤

⎦

⎥

⎡

⎣

⎢

⎤

⎦

⎥

T

c

ij

=

x

i

−

μ

( )

T

v

j

v

i

T

v

j

= δ

ij

λ

1

≥ λ

2

≥  ≥ λ

D

≥ 0

ˆ

Σ = λ

i

v

i

v

i

T

i = 1

M

∑

PCA via the Snapshot Method

μ

x

1

,…, x

N

{ }

=

μ + c

∑

1 j

v

j

,…

{ }

=

Truncated Gaussian Detection

Σ = λ

k

v

k

v

k

T

k = 1

D

Σ = λ

k

v

k

v

k

T

k = 1

M

ρ v

k

v

k

T

k = M + 1

D

− 1

1

λ

k

v

k

v

k

T

k = 1

M

1

ρ

v

k

v

k

T

k = M + 1

D

− 1

1

λ

k

1

ρ

v

k

v

k

T

k = 1

M

1

ρ

I

Σ = λ

k k = 1

M

ρ

k = M + 1

D

  • Approximate Σ with PCA plus spherical term via

Eigenvalues

Specific

Eigenvalues &

Eigenvectors

Spherical

ρ =

1

D − M

λ

k k = M + 1

D

1

D − M

λ

k k = 1

D

− λ

k k = 1

M

1

D − M

kk

k = 1

D

− λ

k

k = 1

M

kk

1

N

x

i

k

− μ k

2

i = 1

N

p x | μ,

ˆ

Σ