210 likes | 479 Views
Lecture 5I Function Approximation. Data driven function approximation Projective hyper-tangent function. Interpolation vs approximation. Polynomial interpolation Constraints: f(x i )=y i for all I Polynomial approximation Minimization of mean square error Non-polynomial approximation
E N D
Lecture 5I Function Approximation • Data driven function approximation • Projective hyper-tangent function 數值方法
Interpolation vs approximation • Polynomial interpolation • Constraints: f(xi)=yi for all I • Polynomial approximation • Minimization of mean square error • Non-polynomial approximation • Minimization of mean square error 數值方法
Data Driven Function Approximation • Input • Paired data • Output • An approximating function • Requirement • Minimization of mean square error 數值方法
Approximating function f: a mapping realized by weight sum of hyper-tangent functions 數值方法
Why weight sum of hyper-tangent functions ? With only linear combination, the approximating function is linear 數值方法
Install NNSYSID • Install • Download • Set path to recruit the directory where NNSYSID.zip is extracted The NNSYSID Toolbox learn_MLP By Levenberg Marquardt method 數值方法
Example fa1d.m Black box tanh(x+2)+sech(x) y observation x Create paired data DDFA One tanh 數值方法
Single tanh r h=ax+b tanh(h) x Approximate by single tanh tanh(x+2)+sech(x) 數值方法
Example fa1d.m Black box tanh(x+2)+sech(x) y observation x Create paired data DDFA two tanh functions 數值方法
Two weighted tanh functions b1 tanh r1 1 b2 a1 r2 x tanh a2 數值方法
Approximate by two tanh functions tanh(x+2)+sech(x) 數值方法
Multi-Layer Perceptrons (tanhs) b1 tanh r1 1 b2 a1 r2 x tanh a2 INPUT LAYER OUTPUT LAYER HIDDEN LAYER 數值方法
Example fa1d.m Black box sin(x)+sech(x) y observation x Create paired data DDFA two tanh functions 數值方法
Approximate by five tanh functions sin(x)+sech(x) 數值方法
MLP Network b1 tanh r1 b2 1 a1 tanh r2 a2 x bM ……. rM aM tanh rM+1 1 數值方法
Data structure • a=[a1 a2 a3 … aM] • b=[b1 b2 b3 … bM] • r=[r1 r2 r3 … rM rM+1] 數值方法
MLP evaluation Given x,a,b and r, find 數值方法
Procedure: MLP evaluation • Input r,a,b and x,M • y=r(M+1) • Set M to the length of a • For m=1:M • Add r(i)*tanh(x*a(i)+b(i)) to y • Return y 數值方法
y=eval_MLP(x,r,a,b,M); M=length(a) y=r(M+1) for m=1:M exit • Add r(i)*tanh(x*a(i)+b(i)) to y 數值方法
Function approximation Given Find a parametric function that minimize 數值方法
Problem statement Given Minimize 數值方法