Advertisement

PSO-ELM

阅读量:

通过调用csvread函数读取文件路径中的STL数据到变量data中。
样本数量为data矩阵的第一维长度。
时间跨度设定为6个时间单位。
循环运行次数设为样本总数减去时间跨度后的整数部分。
在每次迭代中提取从当前行开始连续的时间跨度内的数据,并将其作为x的第i次行。
测试集起始索引位置设为训练集结束位置减去预测跨度加一。
将训练输入数据标准化处理,并返回标准化参数inputps。
输入特征的数量等于原始数据矩阵的列数。
隐层神经元数目设置为12个。
将测试输出数据范围从测试起始位置到末尾行进行赋值。

**len = inputnum*hiddennum+hiddennum;
%PSO参数
c1 = 2;
c2 = 2;
sizepop = 20;
k = 100;
w = 0.9 **

param = rand(sizepop,len);
speed = rand(sizepop,len);

for i ranging from 1 to sizepop
construct IW by reshaping param(i,1:inputnum*hiddennum) into a matrix with hiddennum rows and inputnum columns.
extract B as the slice from

全部评论 (0)

还没有任何评论哟~