Matlab函数拟合之Neural Network方法记录

程序如下:

clear all; close all;

x = [0 1 2 3 4 5 6 7 8];
x1 = [0:0.1:8];
t = [0 0.84 0.91 0.14 -0.77 -0.96 -0.28 0.66 0.99];
% plot(x,t,'o')

net = feedforwardnet(5);
net = configure(net,x,t);
net.trainParam.showWindow = false;
% net.trainParam.showCommandLine = false; 
net.divideParam.trainRatio = 0.7;
net.divideParam.valRatio = 0.15;
net.divideParam.testRatio = 0.15;
net = train(net,x,t);
y1 = net(x1);
y2 = net(x);

plot(x,t,'o',x1,y1,'b',x,y2,'r')

其中,为了避免训练过程中弹出nntraintool的窗口,必须在configure之后、train之前加入trainParam.showWindow=false的设置。

  • 0
    点赞
  • 1
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值