赞
踩
果蝇算法(Fruit Fly Optimization Algorithm, FFOA)是一种启发式优化算法,受果蝇觅食行为的启发。将其应用于优化BP神经网络,主要是为了寻找BP神经网络中的最佳权重和偏置值。以下是一个基本的流程:
初始化:
果蝇算法迭代:
终止条件判断:
输出最终结果:
完整代码见: https://download.csdn.net/download/corn1949/89238786
MATLAB部分主程序:
程序结果:
果蝇算法优化得到的最优目标函数值
bestvalue =
2
果蝇算法优化得到的最优染色体
bestfoamat =
1 至 6 列
0.988013453737499 1.24848767449478 2.63139228302966 -2.45689062435166 1.09759174670344 -2.3276964551277
7 至 12 列
-1.45250094947559 -2.48403512345446 -2.83742821992485 -2.40487538087679 1.5645881638817 1.71939907522149
13 至 18 列
1.51535693707892 -1.20921676590878 -1.40031344243859 1.83816894972747 -0.766932983833384 1.79162844928499
19 至 24 列
1.11253199621565 -0.427120294063871 -1.79103777150325 -1.00246713626167 2.10817146497831 -0.787418623548274
25 至 30 列
-0.118634739100358 -0.0478901154423192 -0.140215822855959 0.777481248134257 0.499079194380242 -0.189891215775598
31 至 36 列
0.00330242667044278 -0.556433886025526 -0.275880369518623 0.151291751485942 -0.681965176365831 1.06366911434983
37 至 42 列
0.685298505199533 -0.029015590109355 -0.324475441232236 -0.0906526312234429 -2.62539591455152 -2.14185139714429
43 至 48 列
-1.28210992851412 0.152196157150784 0.0358317522134368 -1.00317626784754 -2.20146275860155 -2.71384316208486
49 至 50 列
0.545368765661898 -0.0313240323983621
FOA-BP预测指标
premat_FOABP =
42 0
1 7
vmat_FOABP =
1
0.875
accuracy_FOABP =
0.98
FOA-BP神经网络预测准确率(%)=
FOABPa =
98
BP预测指标
premat_BP =
37 5
1 7
vmat_BP =
0.880952380952381
0.875
accuracy_BP =
0.88
BP神经网络预测准确率(%)=
BPa =
88
>>
Copyright © 2003-2013 www.wpsshop.cn 版权所有,并保留所有权利。