一个非常优秀的BP神经网络源程序.doc

  1. 1、本文档共8页,可阅读全部内容。
  2. 2、原创力文档(book118)网站文档一经付费(服务费),不意味着购买了该文档的版权,仅供个人/单位学习、研究之用,不得用于商业用途,未经授权,严禁复制、发行、汇编、翻译或者网络传播等,侵权必究。
  3. 3、本站所有内容均由合作方或网友上传,本站不对文档的完整性、权威性及其观点立场正确性做任何保证或承诺!文档内容仅供研究参考,付费前请自行鉴别。如您付费,意味着您自己接受本站规则且自行承担风险,本站不退款、不进行额外附加服务;查看《如何避免下载的几个坑》。如果您已付费下载过本站文档,您可以点击 这里二次下载
  4. 4、如文档侵犯商业秘密、侵犯著作权、侵犯人身权等,请点击“版权申诉”(推荐),也可以打举报电话:400-050-0827(电话支持时间:9:00-18:30)。
查看更多
一个非常优秀的BP神经网络源程序

?一个非常优秀的BP神经网络源程序 % Construct the network object net = network; % Specify the input and layer size net.numInputs = 1; net.numLayers = 3; % Set connections among all parts net.biasConnect = [1; 1; 1]; net.inputConnect = [1; 1; 0]; net.layerConnect = [0 0 0; %(1, j): connect to layer 1 from layer j 1 0 0; %(2, j): connect to layer 2 from layer j 0 1 0]; %(3, j): connect to layer 3 from layer j net.outputConnect = [0 0 1]; net.targetConnect = [0 0 1]; % Set input range net.inputs{1}.range = [-2 2; -1 1; -2 2; -1 1; -1 1]; % Set neural number for layer 1 net.layers{1}.size = 4; %8, 10, 15 % Set transfer functions for layer 1 net.layers{1}.transferFcn = purelin; % Set initial function for layer 2 net.layers{1}.initFcn = initnw; % Set neural number for layer 2 net.layers{2}.size = 3; %4, 10, 15 % Set transfer functions for layer 2 net.layers{2}.transferFcn = tansig; % Set initial function for layer 2 net.layers{2}.initFcn = initnw; % Set neural number for layer 3 net.layers{3}.size = 1; % Set transfer functions for layer 3 net.layers{3}.transferFcn = purelin; % Set initial function for layer 3 net.layers{3}.initFcn = initnw; % Set input weight delays for layer 1 net.inputWeights{1,1}.delays = [0 1 2 3 5 7 10 15 20 25 30 40 50 60 80]; %from input 1 to layer 1 net.inputWeights{2,1}.delays = [0 1 2 7 10 30]; %from input 1 to layer 2 net.initFcn = initlay; net.performFcn = mse; % Choose the train method net.adaptFcn = trainlm; % Initialize the optimized parameters in net works net = init(net); % Set data file: Loading orignal data fNameIn1=testFileName; fileName1 = fullfile(C:, stockeys, stockDatabase, NYStock60, fNameIn1{ii}); fid = fopen(fileName1); data = fscanf(fid,%d, %d, %g, %g, %g, %g, %g,[7 inf]); data=data; fclose(fid); date=data(:,1); time=data(:,2); openp=data(:,3); highp=data(:,4); lowp=data(:,5); closep=data(:,6); volume=data(:,7); endLine_wholwFile=size(time); file_Length=endLine_wholwFile; % Set input da

您可能关注的文档

文档评论(0)

yurixiang1314 + 关注
实名认证
内容提供者

该用户很懒,什么也没介绍

1亿VIP精品文档

相关文档