求神经网络程序,最好用MATLAB来实现

题目:两种倒置过程的神经网络控制设计及比较要求:如下面图片所示... 题目:两种倒置过程的神经网络控制设计及比较
要求:如下面图片所示
展开
 我来答
百度网友dcdbb9d
2010-01-16 · TA获得超过1179个赞
知道大有可为答主
回答量:977
采纳率:0%
帮助的人:960万
展开全部
希望以下程序对你有所帮助
function net = MY_newff(pr,s,tf,btf,blf,pf)

%空网络
if nargin < 2
net = newnet('newff');
return
end

% 参数缺省,默认值!
if nargin < 4, btf = 'trainlm'; end
if nargin < 5, blf = 'learngdm'; end
if nargin < 6, pf = 'mse'; end

% Error checking
if (~isa(pr,'double')) | ~isreal(pr) | (size(pr,2) ~= 2)
error('Input ranges is not a two column matrix.')
end
if any(pr(:,1) > pr(:,2))
error('Input ranges has values in the second column larger in the values in the same row of the first column.')
end
if isa(s,'cell')
if (size(s,1) ~= 1)
error('Layer sizes is not a row vector of positive integers.')
end
for i=1:length(s)
si = s{i};
if ~isa(si,'double') | ~isreal(si) | any(size(si) ~= 1) | any(si<1) | any(round(si) ~= si)
error('Layer sizes is not a row vector of positive integers.')
end
end
s = cell2mat(s);
end
if (~isa(s,'double')) | ~isreal(s) | (size(s,1) ~= 1) | any(s<1) | any(round(s) ~= s)
error('Layer sizes is not a row vector of positive integers.')
end

% More defaults
Nl = length(s);
if nargin < 3, tf = {'tansig'}; tf = [tf(ones(1,Nl))]; end

% Architecture
net = network(1,Nl);
net.biasConnect = ones(Nl,1);
net.inputConnect(1,1) = 1;
[j,i] = meshgrid(1:Nl,1:Nl);
net.layerConnect = (j == (i-1));
net.outputConnect(Nl) = 1;
net.targetConnect(Nl) = 1;

% Simulation
net.inputs{1}.range = pr;
for i=1:Nl
net.layers{i}.size = s(i);
net.layers{i}.transferFcn = tf{i};
end

% Performance
net.performFcn = pf;

% Adaption
net.adaptfcn = 'trains';
net.inputWeights{1,1}.learnFcn = blf;
for i=1:Nl
net.biases{i}.learnFcn = blf;
net.layerWeights{i,:}.learnFcn = blf;
end

% Training
net.trainfcn = btf;

% Initialization
net.initFcn = 'initlay';
for i=1:Nl
net.layers{i}.initFcn = 'initnw';
end
net = init(net);
左海一舟
2010-01-05 · TA获得超过1044个赞
知道小有建树答主
回答量:581
采纳率:0%
帮助的人:0
展开全部
Matlab的神经网络工具箱里面多得很。
已赞过 已踩过<
你对这个回答的评价是?
评论 收起
推荐律师服务: 若未解决您的问题,请您详细描述您的问题,通过百度律临进行免费专业咨询

为你推荐:

下载百度知道APP,抢鲜体验
使用百度知道APP,立即抢鲜体验。你的手机镜头里或许有别人想知道的答案。
扫描二维码下载
×

类别

我们会通过消息、邮箱等方式尽快将举报结果通知您。

说明

0/200

提交
取消

辅 助

模 式