function net = jordan_p1(p,t,s,tf,btf,blf,pf,ipf,tpf,ddf)
if nargin < 1, error('NNET:Arguments','Not enough arguments.'),end
% Defaults
if (nargin < 3), s = []; end
if (nargin < 4), tf = {}; end
if (nargin < 5), btf = 'traingdx'; end
if (nargin < 6), blf = 'learngdm'; end
if (nargin < 7), pf = 'mse'; end
if (nargin < 8), ipf = {'fixunknowns','removeconstantrows','mapminmax'}; end
if (nargin < 9), tpf = {'removeconstantrows','mapminmax'}; end
if (nargin < 10), ddf = 'dividerand'; end
% Error checking
if (~isa(p,'double')) || ~isreal(p)
error('NNET:Arguments','Inputs are not a matrix or cell array with a single matrix.')
end
if isa(s,'cell')
if (size(s,1) ~= 1)
error('NNET:Arguments','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('NNET:Arguments','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('NNET:Arguments','Layer sizes is not a row vector of positive integers.')
end
% Simulation
net.inputs{1}.exampleInput = p;
net.inputs{1}.processFcns = ipf; %pre-processing conditions for less arguments in the newjor
for i=1:Nl
if (i<Nl)
net.layerWeights{i,i+1}.delays = 1;
else
net.layerWeights{Nl,Nl}.delays = 1 ;
end
if (i<Nl), net.layers{i}.size = s(i); end
if (length(tf) < i) || all(isnan(tf{i}))
if (i<Nl)
net.layers{i}.transferFcn = 'tansig';
else
net.layers{i}.transferFcn = 'purelin';
end
else
net.layers{i}.transferFcn = tf{i};
end
end
net.outputs{Nl}.exampleOutput = t;
net.outputs{Nl}.processFcns = tpf;
% 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;
net.dividefcn = ddf;
net.performFcn = pf;
net.gradientFcn = feval(btf,'gdefaults',0);
% Initialization
net.initFcn = 'initlay';
for i=1:Nl
net.layers{i}.initFcn = 'initnw';
end
net = init(net);
% Plots
net.plotFcns = {'plotperform','plottrainstate'};
%===========================================
%this is similar to the above function written for the lower end MATLAB
%version of NNT tooblox
function net = jordan_p0(pr,s,tf,btf,blf,pf)
% Backward compatible to NNT 5.0
if nargin < 1, error('NNET:Arguments','Not enough arguments.'),end
% Defaults
Nl = length(s);
if nargin < 3, tf = {'tansig'}; tf = tf(ones(1,Nl)); end
if nargin < 4, btf = 'traingdx'; end
if nargin < 5, blf = 'learngdm'; end
if nargin < 6, pf = 'mse'; end
% Initialization
net.initFcn = 'initlay';
for i=1:Nl
net.layers{i}.initFcn = 'initnw';
end
net = init(net);
% Plots
net.plotFcns = {'plotperform','plottrainstate'};
newstsr.zip_grassbqh_一种神经网络构造的新方法
版权申诉
18 浏览量
2022-07-15
07:56:10
上传
评论
收藏 1KB ZIP 举报
JonSco
- 粉丝: 69
- 资源: 1万+
最新资源
- 基于pytorch+Unet进行MRI肝脏图像分割源码+数据集+模型.zip
- 在Android Studio中开发一个Android App项目步骤
- 基于yolov8实现进行物体跟踪源码.zip
- Java多线程学习Java多线程学习Java多线程学习Java多线程学习.txt
- 算法数据结构-动态规划算法(Dynamic Programming)超详细总结加应用案例讲解.txt
- 2024最强秋招八股文(精简、纯手打)2024最强秋招八股文(精简、纯手打).txt
- 基于tensorflow多特征融合的微表情识别python源码.zip
- 基于yolov8实现人脸检测的python源码+运行说明.zip
- Micron Memory DDR3 SDRAM 全系列AD集成库(原理图库+PCB封装库).IntLib
- 基于tensorflow多特征融合的微表情识别python源码+详细使用说明.zip
资源上传下载、课程学习等过程中有任何疑问或建议,欢迎提出宝贵意见哦~我们会及时处理!
点击此处反馈