看板 MATLAB 關於我們 聯絡資訊
________________________________________________________ clear all; %define the input and output p= [974 874 527; 388 466 1764; 1316 2439 2251; 1836 2410 1860; 1557 2301 1578; 1490 1877 2749; 1513 1278 2026; 1070 1561 2794; 1347 2415 3306; 1324 2746 1233; 1383 1463 1847; 1282 0 2347]; t=[19797 24282 34548]; % 创建bp网络和定义训练函数 % 这里是为了方便而建立一个矩阵,注意是12x2,不是3x2 pr=[ 527 974; 388 1764; 1316 2439; 1836 2410; 1557 2301; 1490 2749; 1278 2026; 1070 2794; 1347 3306; 1233 2746; 1383 1847; 0 2347] net=newff(pr,[15,1],{'tansig' 'purelin'},'trainlm'); %这里要加入输出层的转移函 数,一般是trainlm net.trainparam.goal=50; net.trainparam.epochs=5000; %训练神经网络 [net,tr]=train(net,p,t); %输出训练后的权值和阈值 iw1=net.IW{1}; b1=net.b{1}; lw2=net.LW{2}; b2=net.b{2}; %存储训练好的神经网络 save netkohler net _____ 強者們好, 我已訓練好net了, 請問我怎麼使用這net? 求跪有好心老師指導, <(_ _)> -- ※ 發信站: 批踢踢實業坊(ptt.cc), 來自: 110.26.173.213 ※ 文章網址: https://www.ptt.cc/bbs/MATLAB/M.1548141856.A.459.html
justoneshoot: Z=sim(net,輸入向量)Z就是類神經網路的結果01/22 19:22
謝謝 :) ※ 編輯: g318 (110.26.173.213), 01/22/2019 21:06:21