% showmlp.m (ct, Jan 13, 2000) % plots prediction results of serial MLP % cf. ENI exercise 15 % --- parameters --- n = 50; m = 150; % --- calculate plain sine --- X = [0:m]' * 2*pi/n; Y = sin(X); xy = [(0:m)' Y]; % --- load MLP results --- d = 2; load -force serial_mlp2.res mlp2 = [(d:m)' serial_mlp2(1:m-d+1)]; d = 5; load -force serial_mlp5.res mlp5 = [(d:m)' serial_mlp5(1:m-d+1)]; d = 10; load -force serial_mlp10.res mlp10 = [(d:m)' serial_mlp10(1:m-d+1)]; % --- display results --- % in the plot,t=0 corresponds to x=0 and sin(x)=0. clg; hold on; xlabel("Time"); title("Prediction of sine values"); axis([0 m -1.0 1.7]); gplot xy w l title "plain sine"; gplot mlp2 w p title "serial MLP with DIM=2"; gplot mlp5 w p title "serial MLP with DIM=5"; gplot mlp10 w p title "serial MLP with DIM=10"; % --- save as Postscript --- if 1 gset term post gset output "smlp.ps" replot gset term X endif