⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 rbf_approx.m

📁 RBF神经网络是一种具有单隐层的三层前馈网络
💻 M
字号:
clc;
clear;
close all;

%???????, generate the learing data
ld=400; %???????
x=rand(2,ld); %0-1
x=(x-0.5)*1.5*2; %-1.5, 1.5
x1=x(1,:);
x2=x(2,:);
F=20+x1.^2-10*cos(2*pi*x1)+x2.^2-10*cos(2*pi*x2);


%???????
net=newrb(x,F);

%generate the testing data
interval=0.1;
[i, j]=meshgrid(-1.5:interval:1.5);
row=size(i);
tx1=i(:);
tx1=tx1';
tx2=j(:);
tx2=tx2';
tx=[tx1;tx2];

%testing
ty=sim(net,tx);

v=reshape(ty,row);
figure
subplot(1,3,2)
mesh(i,j,v);
zlim([0,60])

%plot the original function
interval=0.1;
[x1, x2]=meshgrid(-1.5:interval:1.5);
F = 20+x1.^2-10*cos(2*pi*x1)+x2.^2-10*cos(2*pi*x2);
subplot(1,3,1)
mesh(x1,x2,F);
zlim([0,60])

%plot the error
subplot(1,3,3)
mesh(x1,x2,F-v);
zlim([0,60])

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -