请选择 进入手机版 | 继续访问电脑版

Hello Mat

 找回密码
 立即注册
查看: 6394|回复: 0

7-改进的GA算法优化的BP神经网络+寻找最优条件

[复制链接]

1288

主题

1514

帖子

90

金钱

管理员

Rank: 9Rank: 9Rank: 9

积分
22589
发表于 2017-7-29 12:32:04 | 显示全部楼层 |阅读模式
百度网盘链接:
7-改进的GA算法优化的BP神经网络+寻找最优条件--MATLAB视频

参考链接:
3遗传算法 + (PPT+参考文献) + 源程序
【2】遗传算法GA优化的BP神经网络

具体链接在halcom.cn论坛,联系人QQ:3283892722
该论坛是一个学习交流平台,我会逐一的和大家分享学习。
欢迎大家录制视频,你可在论坛进行打赏分享。
视频专用播放器:http://halcom.cn/forum.php?mod=viewthread&tid=258&extra=page%3D1

改进点:
(1)将第一次运行的种群结果保存,作为第二次运行的初始解;
(2)将样本分为70%训练样本,15%验证样本,15%的测试样本;
(3)将训练样本训练网络,用验证样本进行测试网络,测试均方根误差作为适应度值;

网络结构训练好后,保存net,用于寻优计算:
  1. % 清空环境变量
  2. clc,clear,close all
  3. warning off
  4. load('GABP_net.mat')
  5. %% BP网络预测
  6. k=1;
  7. for x1=120:10:180
  8.     for x2=60:10:120
  9.         for x3=0.4:0.05:0.8
  10.             for x4=7.5:0.5:12.5
  11.                 test = [x1,x2,x3,x4]';
  12.                 test_data(k,:) = [x1,x2,x3,x4];
  13.                 testn =mapminmax('apply',test,inputps);
  14.                 testn_simu(k,:)=sim(net,testn);
  15.                 k=k+1;
  16.             end
  17.         end
  18.     end
  19. end
  20. save testn_simu.mat
  21. %% 显示最优结果1
  22. load('testn_simu.mat')
  23. XyG = testn_simu(:,1)./testn_simu(:,2);
  24. [maxValue,maxFlag] = max(XyG);
  25. best_input = test_data(maxFlag,:);
  26. best_output = testn_simu(maxFlag,:);
  27. fprintf('\n')
  28. disp(['最优条件:', num2str( best_input )])
  29. disp(['最优结果:', num2str( best_output )])
复制代码






算法QQ  3283892722
群智能算法链接http://halcom.cn/forum.php?mod=forumdisplay&fid=73
回复

使用道具 举报

您需要登录后才可以回帖 登录 | 立即注册

本版积分规则

Python|Opencv|MATLAB|Halcom.cn ( 蜀ICP备16027072号 )

GMT+8, 2024-3-29 20:03 , Processed in 0.202258 second(s), 21 queries .

Powered by Discuz! X3.4

Copyright © 2001-2021, Tencent Cloud.

快速回复 返回顶部 返回列表