18
The FAST Gauss Transform MATH 191 Final Presentation By Group III Akua Agyapong, Adrian Ilie, Jameson Miller, Eli Rosen, Nikolay Stoynov

The FAST Gauss Transform MATH 191 Final Presentation By Group III Akua Agyapong, Adrian Ilie, Jameson Miller, Eli Rosen, Nikolay Stoynov

  • View
    213

  • Download
    0

Embed Size (px)

Citation preview

Page 1: The FAST Gauss Transform MATH 191 Final Presentation By Group III Akua Agyapong, Adrian Ilie, Jameson Miller, Eli Rosen, Nikolay Stoynov

The FAST Gauss Transform

MATH 191 Final Presentation

By Group III

Akua Agyapong, Adrian Ilie, Jameson Miller,

Eli Rosen, Nikolay Stoynov

Page 2: The FAST Gauss Transform MATH 191 Final Presentation By Group III Akua Agyapong, Adrian Ilie, Jameson Miller, Eli Rosen, Nikolay Stoynov

Discrete Gauss Transform

/||

1

2

)( jk sxN

jjk eqxG

Weight coefficients Source locations

Target locations

=1

Page 3: The FAST Gauss Transform MATH 191 Final Presentation By Group III Akua Agyapong, Adrian Ilie, Jameson Miller, Eli Rosen, Nikolay Stoynov

Direct Gauss Transform

x1 x2 x3 x4 xi xM. . . . . .. .

.. .

.

s1

si

sN

. . .

. . .

. . .

. . .

. . .

• Naïve solution: O(NM)

Page 4: The FAST Gauss Transform MATH 191 Final Presentation By Group III Akua Agyapong, Adrian Ilie, Jameson Miller, Eli Rosen, Nikolay Stoynov

Direct Gauss Transform

• Simple, but slow algorithm• Pseudo code:

targets[] - array of target pointsresults[] - array of values at target points sources[] - array of source pointsweights[] - array of weights associated with source points

for(int i = 0; i < numTargetPoints; i++) { results[i] = 0; for(int j = 0; j < numSourcePoints; j++){ results[i] += weights[j]* e^(targets[i] - sources[j]) }}

Page 5: The FAST Gauss Transform MATH 191 Final Presentation By Group III Akua Agyapong, Adrian Ilie, Jameson Miller, Eli Rosen, Nikolay Stoynov

Fast Gauss Transform

• Less costly algorithm using Numerical Approximation:

2

0

2

P

Pp

Li p x

p

x

eC

e

L

• Interval Length and Number of Coefficients?

Page 6: The FAST Gauss Transform MATH 191 Final Presentation By Group III Akua Agyapong, Adrian Ilie, Jameson Miller, Eli Rosen, Nikolay Stoynov

Gaussian

• Approximation– Determine interval length, L

• Error =

• Fourier Series (smooth, periodic function)

– Calculate coefficients

– Optimal number of terms• Determined by excluding extremely small Fourier

coefficients• P=20

2xe

dxeeL

CL

L

Lxpix

p

2/

2/

221

Page 7: The FAST Gauss Transform MATH 191 Final Presentation By Group III Akua Agyapong, Adrian Ilie, Jameson Miller, Eli Rosen, Nikolay Stoynov

Evaluation of Fourier Series (1)

n

nkk

n

nkk kxbikxaxf )sin()cos()(

• The result of the evaluation of a Fourier Series is a complex number– C++ has a complex number template in the STL

• Supplies correct implementation of addition, multiplication and other algebraic operations

• No conjugate member function

Page 8: The FAST Gauss Transform MATH 191 Final Presentation By Group III Akua Agyapong, Adrian Ilie, Jameson Miller, Eli Rosen, Nikolay Stoynov

Evaluation of Fourier Series (2)

• Since the Gaussian is an even function, the imaginary part drops out

• ai = a-i , so we can combine them into one step

)cos(2

))cos()cos((

1

1

n

kko

n

kkko

kxaa

xkaxkaa

)cos()(

n

nkk kxaxf

Page 9: The FAST Gauss Transform MATH 191 Final Presentation By Group III Akua Agyapong, Adrian Ilie, Jameson Miller, Eli Rosen, Nikolay Stoynov

Fast Gauss Transform

• Implementation:

)()(2

)(

P

Pp

Lsxip

p

N

Njjkk

jkk

k

eCqGxG

• Rearrangement:

LipsN

Njj

P

Ppp

Lxip

k

jk

k

k

eqCeG 22

)(

Wpk

Page 10: The FAST Gauss Transform MATH 191 Final Presentation By Group III Akua Agyapong, Adrian Ilie, Jameson Miller, Eli Rosen, Nikolay Stoynov

Recursion

• Index shift:

)(

)(

)(

)(

2)(

1

2)(1

2)(

2)(

1

11

11

1

11

1

P

Pp

Lsxip

p

N

Njj

P

Pp

Lsxip

p

N

Njj

P

Pp

Lsxip

p

N

Njj

P

Pp

Lsxip

p

N

Njjk

jkk

k

jkk

k

jkk

k

jkk

k

eCq

eCq

eCq

eCqG

Wpk

Wp-k+1

Wp+k+1

Page 11: The FAST Gauss Transform MATH 191 Final Presentation By Group III Akua Agyapong, Adrian Ilie, Jameson Miller, Eli Rosen, Nikolay Stoynov

Sliding the evaluation window

)( 112

1

1

kp

kp

P

Pp

kp

Lxpi

k WWWeGk

Already calculated directly

inf k sup k

inf k+1 sup k+1

xk

xk+1

Page 12: The FAST Gauss Transform MATH 191 Final Presentation By Group III Akua Agyapong, Adrian Ilie, Jameson Miller, Eli Rosen, Nikolay Stoynov

Algorithm – initial phase

• Determine inf0 and sup0

• Compute

• Compute

PPpeqCW LSpi

jjpp

j

...,2sup

inf

00

0

LxpiP

Ppp eWG

20

0

0

Total Work: O(1)

Page 13: The FAST Gauss Transform MATH 191 Final Presentation By Group III Akua Agyapong, Adrian Ilie, Jameson Miller, Eli Rosen, Nikolay Stoynov

Algorithm – loop phase, i=1..N

• Advance infk and supk to infk+1 and supk+1

• Compute

• Compute

• Compute

• Compute

PPpeqCW LSpi

jjp

kp

jk

k

...,21inf

inf

11

LxpiP

Pp

pkk

k

eWG2

PPpeqCW LSpi

jjp

kp

jk

k

...,2sup

1sup

11

111

kp

kp

kp

kp WWWW

Total Work: O(N)

Page 14: The FAST Gauss Transform MATH 191 Final Presentation By Group III Akua Agyapong, Adrian Ilie, Jameson Miller, Eli Rosen, Nikolay Stoynov

Timing comparison

Timing comparison

0

500000

1000000

1500000

2000000

2500000

3000000

3500000

Number of targets

Tim

e (m

s)

O(n2)

Trunc

Appr

O(n)

O(n2) 203 735 2812 10968 43344 173985 687141 3E+06

Trunc 16 46 141 547 2187 8750 34250 238877

Appr 31 79 218 719 2453 9296 35516 239501

O(n) 47 93 204 437 813 1782 3265 10750

512 1024 2048 4096 8192 16384 32768 65536

Page 15: The FAST Gauss Transform MATH 191 Final Presentation By Group III Akua Agyapong, Adrian Ilie, Jameson Miller, Eli Rosen, Nikolay Stoynov

Timing comparison (log scale)

Timing comparison (log scale)

0

2

4

6

8

10

12

14

16

Number of targets

log(

Tim

e) (m

s) O(n2)

Trunc

Appr

O(n)

O(n2) 5.3132 6.5999 7.9417 9.3027 10.677 12.067 13.44 14.872

Trunc 2.7726 3.8286 4.9488 6.3044 7.6903 9.0768 10.441 12.384

Appr 3.434 4.3694 5.3845 6.5779 7.8051 9.1373 10.478 12.386

O(n) 3.8501 4.5326 5.3181 6.0799 6.7007 7.4855 8.091 9.2827

512 1024 2048 4096 8192 16384 32768 65536

Page 16: The FAST Gauss Transform MATH 191 Final Presentation By Group III Akua Agyapong, Adrian Ilie, Jameson Miller, Eli Rosen, Nikolay Stoynov

Applications

• Option pricing– Determining optimal selling strategy by sum

of Gaussians

Mark Broadie and Yusaku Yamamoto, January 2002

Page 17: The FAST Gauss Transform MATH 191 Final Presentation By Group III Akua Agyapong, Adrian Ilie, Jameson Miller, Eli Rosen, Nikolay Stoynov

Applications

• Color tracking– Mixture of Gaussians for modeling regions

with a mixture of color.

Ahmed Elgammal et al, IEEE,Transactions on Pattern Analysis and Machine Intelligence, November 2003

Page 18: The FAST Gauss Transform MATH 191 Final Presentation By Group III Akua Agyapong, Adrian Ilie, Jameson Miller, Eli Rosen, Nikolay Stoynov

Recent Developments

• Improved Fast Gauss Transform

FGT has successfully accelerated the kernel density estimation to linear running time for low dimensional problems. However, the cost of a direct extension of the FGT to higher-dimensional grows exponentially with dimension, making it impractical for dimension above 3.

C. Yang, R. Duraiswami, N. A.. Gumerov and L. Davis – ICCV 2003