390 likes | 549 Views
Math Primer. Outline. Calculus: derivatives, chain rule, gradient descent, taylor expansions Bayes Rule Fourier Transform Dynamical linear systems. Calculus. Derivatives Derivative=slope. Calculus. Derivative: a few common functions (x n )’=nx n-1 (x -1 )’=-1/x 2 = x -2
E N D
Outline • Calculus: derivatives, chain rule, gradient descent, taylor expansions • Bayes Rule • Fourier Transform • Dynamical linear systems
Calculus • Derivatives • Derivative=slope
Calculus • Derivative: a few common functions • (xn)’=nxn-1 • (x-1)’=-1/x2 = x-2 • exp(x)’=exp(x) • log(x)’=1/x • cos(x)’=-sin(x)
Calculus • Derivative: Chain rule • Ex: gaussian • z=h(x)=exp(-x2)’,f(y)=exp(y), y=g(x)=-x2 • f’(y)=exp(y)= exp(-x2), g’(x)=-2x • z’= f’(y)g’(x) =exp(-x2)(-2x)
Calculus • Finding minima: gradient descent f’(x0) < 0 f(x) dx > 0 f’(x*)=0 x0+dx x0 x* dx = -a f’(x0)
Calculus • Example: minimizing an error function
Calculus • Taylor expansion
Bayes rule • Example: drawing from 2 boxes • 2 boxes (B1,B2) • P(B1)=0.2,P(B2)=0.8 (Prior) • Balls with two colors (R,G) • B1=(16R,8G), B2=(8R,16G) • P(R|B1)=2/3, P(G|B1)=1/3 (Conditional) • P(R|B2)=1/3, P(G|B2)=2/3 (Conditional)
Bayes rule • Joint distributions • P(G,B1)=P(B1)P(G|B1)=0.2*0.33=0.066 • P(G,B2)=P(B2)P(G|B2)=0.8*0.66=0.528 • P(X,Y)=P(X|Y)P(Y) • P(Y,X)=P(Y|X)P(X) • P(Y|X)P(X)=P(X|Y)P(Y)
How do you get this? Marginalize Bayes rule • Bayes rule • P(Y|X)P(X)=P(X|Y)P(Y) • P(Y|X)=P(X|Y)P(Y)/P(X) • If you draw G, what is the probability that it came from box1? • P(B1|G)=P(G|B1)P(B1)/P(G)
Bayes rule Marginalization • P(G)=P(G,B1)+P(G,B2)=0.066+0.528=0.6 • P(G)=P(G|B1)P(B1)+P(G|B2)P(B2) • P(Y)=Sx P(Y,X) • P(Y)=Sx P(Y|X)P(X) • P(Y|X)=P(X|Y)P(Y)/SYP(X|Y)P(Y)
Sum to one Bayes rule • Bayes rule • If you draw G, what is the probability that it came from Box1 or Box2? • P(B1|G)=P(G|B1)P(B1)/P(G) =(0.33*0.2)/0.6=0.11 • P(B2|G)=P(G|B2)P(B2)/P(G) =(0.66*0.8)/0.6=0.89
Bayes rule • P(A,B|C)=P(A|B,C)P(B|C) • P(B|A,C)=P(A|B,C)P(B|C)/P(A|C)
Fourier transform • Basis in linear algebra • Basis function: dirac • Basis function: sin
Fourier Transform • Decomposition in sum of sin and cosine • Power: first term is the DC • Phase • Fourier transform for Dirac Sin Gaussian (inverse relationship)
Fourier Transform • Convolution and products
Fourier transform • Fourier transform of a Gabor
Fourier transform • Eigenspace for liner dynamical system…
Dynamical systems • Stable if l<0, unstable otherwise
Dynamical systems Fixed Point
Dynamical systems Stable if f’(x0)<0, unstable otherwise.
Dynamical systems • go into eigen space • Equations decouple Stable ifl1<0, unstable otherwise.
Dynamical systems • go into eigen space • Equations decouple
Dynamical systems • go into eigen space • Equations decouple Stable is f’(x0)<0, unstable otherwise.
Dynamical systems • Fixed point • Saddle point • Unstable point • Stable and unstable oscillations: complex eigenvalues
Nonlinear Networks • Discrete case: Stable if |l|<1, unstable otherwise
Nonlinear Networks • Discrete case:
Nonlinear Networks • Dynamics around attractor:
Nonlinear Networks • Stable Fixed point: |l1|<1, |l2|<1
Nonlinear Networks • Saddle Point: |l1|>1, |l2|<1
Nonlinear Networks • Unstable Fixed point: |l1|>1, |l2|>1
Nonlinear Networks • Line Attractor: l1=1, |l2|<1
Nonlinear Networks • Oscillation: complex l’s
Nonlinear Networks: global stability • Lyapunov Function: function of the state of the system which is bounded below and goes down over time. If such a function exists, the system is globally stable. • Ex: Hopfield network, Cohen-Grossberg network