📄 ex1d1.m
字号:
%==============================================================% Ex1d1: An example for using WaveNet, 1-D Interpolation%==============================================================% By Qinghua Zhang. March, 1994.help ex1d1echo on% The training data%===================% Input patternsx = [-0.9588 -0.8611 -0.7614 -0.6790 -0.6074 -0.4920 -0.3364 ... -0.2987 -0.1644 -0.1520 0.0473 0.1727 0.1766 0.2596 ... 0.3616 0.5276 0.5697 0.6961 0.7437 0.9412 0.9696]';% Output patternsy = [-0.9602 -0.5770 -0.0729 0.3771 0.6405 0.6600 0.4609 ... 0.1336 -0.2013 -0.4344 -0.5000 -0.3930 -0.1647 0.0988 ... 0.3072 0.3960 0.3449 0.1816 -0.0312 -0.2189 -0.3201]';% The data are depicted in the graphics window.clf; plot(x,y,'o'); xlabel('x'); ylabel('y'); title('The data to be interpolated');% We are going to use a WaveNet to interpolate the data.% You may set the number of wavelets in the network to 3% or choose it on-line with the aid of the FPE criterion.% Call the training procedure%=============================Key = keymenu('Make your choice','Use 3 wavelets','On-line choice');if Key==1 th = wnetreg(y, x, 3, 20, 2); % Use 3 wavelets, 20 iterations, % Initialization mode 2else th = wnetreg(y, x, [], 20, 2); % Number of wavelets not determined.end% Examine the result of the interpolation%=========================================% Evaluate the network on a finer x-sequencexg = (-1:.01:1)';yg = wavenet(xg, th);plot(x,y,'o', xg,yg); xlabel('x'); ylabel('y');% The result of the interpolation is ploted in the graphics window.echo off
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -