![利用MATLAB中gatool快速實現(xiàn)訓練神經(jīng)網(wǎng)絡的遺傳算法程序_第1頁](http://file3.renrendoc.com/fileroot_temp3/2022-1/8/ed69fb64-67cd-4e76-92ee-53a504dc5fb3/ed69fb64-67cd-4e76-92ee-53a504dc5fb31.gif)
![利用MATLAB中gatool快速實現(xiàn)訓練神經(jīng)網(wǎng)絡的遺傳算法程序_第2頁](http://file3.renrendoc.com/fileroot_temp3/2022-1/8/ed69fb64-67cd-4e76-92ee-53a504dc5fb3/ed69fb64-67cd-4e76-92ee-53a504dc5fb32.gif)
![利用MATLAB中gatool快速實現(xiàn)訓練神經(jīng)網(wǎng)絡的遺傳算法程序_第3頁](http://file3.renrendoc.com/fileroot_temp3/2022-1/8/ed69fb64-67cd-4e76-92ee-53a504dc5fb3/ed69fb64-67cd-4e76-92ee-53a504dc5fb33.gif)
![利用MATLAB中gatool快速實現(xiàn)訓練神經(jīng)網(wǎng)絡的遺傳算法程序_第4頁](http://file3.renrendoc.com/fileroot_temp3/2022-1/8/ed69fb64-67cd-4e76-92ee-53a504dc5fb3/ed69fb64-67cd-4e76-92ee-53a504dc5fb34.gif)
下載本文檔
版權說明:本文檔由用戶提供并上傳,收益歸屬內容提供方,若內容存在侵權,請進行舉報或認領
文檔簡介
1、利用MATLAB中gatool快速實現(xiàn)訓練神經(jīng)網(wǎng)絡的遺傳算法程序Deng Da-PengEmail: rexdengGenetic Algorithm,as an famous intelligent algorithm based on evolutionary thoughts, has been widely used to weights training and parameters optimization of neural networks. Essentially, GA is a global stochastic searching algorithm, which ap
2、proximating global minima through Selection、Crossover and Mutation operators. It is difficult for many researchers to utilize advanced programming languages to implement GA. Actually, MATLAB provide us a very good graphic user interface of GA, named gatool, in GADS toolbox.Below contents illustrate
3、how to use this GUI tool to implement combination of GA and NN. In this case, I construct a feed forward network, which topological structure is 5-3-1, transfer functions are tansig and purelin for hidden and output layer, respectively. The key step is write a function to calculate fitness of chromo
4、somes in GA population. Below code is implement this fitness calculating function in this case.function netout = netcal(pm) iN=5; hN=3;oN=1; % add your training sets here P= ; T= ; % Pre-processing data sets Pn,minP,maxP,Tn,minT,maxT = premnmx(P,T); net=newff(minmax(Pn),hN,oN,'tansig','p
5、urelin'); x,y=size(pm); for j=1:hN x2iw(j,:)=pm(1,(j-1)*iN+1):j*iN); end for k=1:oN x2lw(k,:)=pm(1,(iN*hN+1):(iN*hN+hN); end x2b=pm(1,(iN+1)*hN+1):y); x2b1=x2b(1:hN).' x2b2=x2b(hN+1:hN+oN).' net.IW1,1=x2iw; net.LW2,1=x2lw; net.b1=x2b1; net.b2=x2b2; netout=mse(sim(net,Pn)-Tn); % this erro
6、r function provides fitness for chromosomeOK, save this function with a name, i.e., netcal.m. Then, let's start gatool in MATLAB command line. The GUI of gatool is below.click then launchparameters settingclick and see helpenter num of weightsenter fitness functionFill name of fitness calculatin
7、g function in fitness function textbox, but note that add '' before function name. Calculate numbers of weights of network, in this case is 22. Then, you need set parameters of GA in right. This step need you understand GA. If any question, you can see help.Complete all these steps, click st
8、art button and launch training. When training process is end ,you will see a best chromosome in lower corner of left. This final result is best weight array of NN trained by GA. Change it to weight matrix and transfer to network according to fitness function code, then simulation with working sets a
9、nd observe network performance.You can generate a m files through "generate M-file" in "file" menu. In this case, the M-file code is showed below. You may add some code in the end of this function for convenience.OK, it is end. Thanks for your reading and hope for your reviews an
10、d comments.best chromosomefunction X,FVAL,REASON,OUTPUT,POPULATION,SCORES = untitled% This is an auto generated M file to do optimization with the Genetic Algorithm and% Direct Search Toolbox. Use GAOPTIMSET for default GA options structure. %Fitness functionfitnessFunction = netcal;%Number of Varia
11、blesnvars = 22; /CEE/professional_development_programs/ %Start with default optionsoptions = gaoptimset;%Modify some parametersoptions = gaoptimset(options,'PopInitRange' ,-0.5 ; 0.5 );options = gaoptimset(options,'StallGenLimit' ,100);options = gaoptimset(options,'CrossoverFcn' , crossoverheuristic 1.2 );options = gaoptimset(options,'MutationFcn' , mutationgaussian 1 1 );options = gaoptimset(options,'Display' ,
溫馨提示
- 1. 本站所有資源如無特殊說明,都需要本地電腦安裝OFFICE2007和PDF閱讀器。圖紙軟件為CAD,CAXA,PROE,UG,SolidWorks等.壓縮文件請下載最新的WinRAR軟件解壓。
- 2. 本站的文檔不包含任何第三方提供的附件圖紙等,如果需要附件,請聯(lián)系上傳者。文件的所有權益歸上傳用戶所有。
- 3. 本站RAR壓縮包中若帶圖紙,網(wǎng)頁內容里面會有圖紙預覽,若沒有圖紙預覽就沒有圖紙。
- 4. 未經(jīng)權益所有人同意不得將文件中的內容挪作商業(yè)或盈利用途。
- 5. 人人文庫網(wǎng)僅提供信息存儲空間,僅對用戶上傳內容的表現(xiàn)方式做保護處理,對用戶上傳分享的文檔內容本身不做任何修改或編輯,并不能對任何下載內容負責。
- 6. 下載文件中如有侵權或不適當內容,請與我們聯(lián)系,我們立即糾正。
- 7. 本站不保證下載資源的準確性、安全性和完整性, 同時也不承擔用戶因使用這些下載資源對自己和他人造成任何形式的傷害或損失。
最新文檔
- 教育行業(yè)在線教育平臺的課程評價體系方案
- 造價咨詢合同
- 2025年天津貨運從業(yè)資格證模擬試題答案解析大全
- 2025年寧德貨物運輸駕駛員從業(yè)資格考試系統(tǒng)
- 電子消費券采購合同(2篇)
- 電力電量分配合同(2篇)
- 電池焊接維修合同(2篇)
- 2024年高考歷史二輪復習“12+2+3”專項練第46題選做題專練
- 2024-2025學年四年級語文上冊第五單元19奇妙的國際互聯(lián)網(wǎng)教案2蘇教版
- 2024-2025學年高中化學第二章化學反應與能量第二節(jié)化學能與電能2發(fā)展中的化學電源課時訓練含解析新人教版必修2
- DB31 SW-Z 017-2021 上海市排水檢測井圖集
- GB/T 707-1988熱軋槽鋼尺寸、外形、重量及允許偏差
- 浮力及浮力的應用
- 公司培訓員工職務犯罪預防講座之職務侵占
- 化學選修4《化學反應原理》(人教版)全部完整PP課件
- 建筑公司工程財務報銷制度(精選7篇)
- 工程設計方案定案表
- 第一章-天氣圖基本分析方法課件
- 暖氣管道安裝施工計劃
- 體育實習周記20篇
- 初二物理彈力知識要點及練習
評論
0/150
提交評論