⛄一、粒子群算法及BP神经网络简介
由于BP神经网络在应用过程中初始权值和阈值随机选取,容易出现局部收敛极小点,从而降低拟合效果,为了解决这个问题,采用PSO优化BP神经网络(PSO-BP)算法的初始权值和阈值,解决局部极小点问题,提高BP神经网络算法的预测精度。在PSO中,整个搜索空间的维数D。第i个粒子的位置见式(3)。
图2 PSO-BP的算法流程
⛄二、部分源代码
function varargout = untitled(varargin)
% UNTITLED MATLAB code for untitled.fig
% UNTITLED, by itself, creates a new UNTITLED or raises the existing
% singleton*.
%
% H = UNTITLED returns the handle to a new UNTITLED or the handle to
% the existing