资源简介
储备池应用,预测Mackey_Glass混沌,初步了解储备池计算。
代码片段和文件信息
% A minimalistic Echo State Networks demo with Mackey-Glass (delay 17) data % in “plain“ Matlab. % by Mantas Lukosevicius 2012 % http://minds.jacobs-university.de/mantas % load the data
function Mackey_Glass_Reservoircomputing
trainLen = 2000; %训练数据长2000
testLen = 2000; %测试长度2000
initLen = 100; %初始化储备池
data = load(‘MackeyGlass_t17.txt‘);% plot some of it
figure(10);
plot(data(1:10000)); %绘制前1000个数据
title(‘A sample of data‘); % generate the ESN reservoir
inSize =1;
outSize = 1; %输入维数
resSize = 1000; %储备池规模
a = 0.3; % leaking rate 更新速率,也可设为1
rand( ‘seed‘ 42 );
%随机生成Win 和 W
Win = (rand(resSize1+inSize)-0.5) .* 1; %输入矩阵N*1+K
W = rand(resSizeresSize)-0.5;%储备池连接矩阵N*N
% Option 1 - direct scaling (quick&dirty reservoir-specific): %
W = W .* 0.13; % Option 2 - normalizing and setting spectral radius (correct slower):
disp ‘Computing spectral radius...‘; %计算谱半径
opt.disp = 0;
rhoW = abs(eigs(W1‘LM‘opt));
disp ‘done.‘
W = W .* ( 1.25 /rhoW); % allocated memory for the design (collected states) matrix
X = zeros(1+inSize+resSizetrainLen-initLen); %储备池状态矩阵x(t),每一列是每个时刻的储备池状态,后面会转置 set the corresponding target matrix directly
Yt = data(initLen+2:trainLen+1)‘; % run the reservoir with the data and collect X
x = zeros(resSize1);
for t = 1:trainLen
u = data(t);
x = (1-a)*x + a*tanh( Win*[1;u] + W*x );
if t > initLen X(:t-initLen) = [1;u;x];
end
end % train the output
reg = 1e-8; % regularization coefficient
X_T = X‘;
Wout = Yt*X_T * inv(X*X_T + reg*eye(1+inSize+resSize)); %
Wout = Yt*pinv(X); % run the trained ESN in a generative mode. no need to initialize here % because x is initialized with training data and we continue from there.
Y = zeros(outSizetestLen);
u = data(trainLen+1);
for t = 1:testLen x = (1-a)*x + a*tanh( Win*[1;u] + W*x );
y = Wout*[1;u;x];
Y(:t) = y; % generative mode:
u = y; % this would be a predictive mode: %
u = data(trainLen+t+1);
end
errorLen = 500;
mse = sum((data(trainLen+2:trainLen+errorLen+1)‘-Y(11:errorLen)).^2)./errorLen;
disp( [‘MSE = ‘ num2str( mse )] ); % plot some signals
figure(1);
plot( data(trainLen+2:trainLen+testLen+1) ‘color‘ [00.750] );
hold on;
plot( Y‘ ‘b‘ );
hold off;
axis tight;
title(‘Target and generated signals y(n) starting at n=0‘);
legend(‘Target signal‘ ‘Free-running predicted signal‘);
figure(2);
plot( X(1:201:200)‘ );
title(‘Some reservoir activations x(n)‘);
figure(3);
bar( Wout‘ )
title(‘Output weights W^{out}‘);
属性 大小 日期 时间 名称
----------- --------- ---------- ----- ----
文件 265427 2017-12-20 09:30 Mackey_Glass_Reservoircomputing\MackeyGlass_t17.txt
文件 2662 2018-03-29 16:34 Mackey_Glass_Reservoircomputing\Mackey_Glass_Reservoircomputing.m
目录 0 2018-09-13 10:01 Mackey_Glass_Reservoircomputing
----------- --------- ---------- ----- ----
268089 3
- 上一篇:opendaylight入门教程
- 下一篇:freeglut-3.2.1.rar
相关资源
- arcgis api for js实现距离测量和面积测量
- iot-dc3-architecture.pptx
- Qt-二维码-采用qrcode库
- apache-camel-1.2.0-src.tar.gz
- 论文研究-一种用于无人机的改进RC-
- 超凡搜索神器超凡搜索(BeyondSearche
- 条码字体-扫描专用
- 图像分类残差网络-pytorch实现
- 赫优讯SERCOS III运动控制通讯从站.ra
- 三菱、西门子、欧姆龙、松下PLC、单
- arcsde10.2百度云连接linux版本
- 64Mircosoftoffice2016.txt
- A HIGH PERFORMANCE OPEN SOURCE SATA2 CORE
- ArcGIS的prj文件转proj4字符串
- 采用arcgis的arcpy写的一个合并多个gd
- ArcGIS10.0全套破解
- arcgis server 10.3破解文件277456
- ArcEngine10.0三维开发
- s7_200实现MUDBUS CRC16校验程序
- jpegsrc.v8d.tar.gz
- mac drcom校园网登录
- SHT75 程序 CRC
- RC522射频模块充值饭卡,水卡
- 好用的各种进制转换工具包括ASCII与
- ArcGIS9.2全套
- solution for computer architecture 5th edition
-
opencv的各种haarcascade.xm
l文件 - 最好的crc32算法,可以直接调用,速度
- 整理好的DWR-2.0.5-src
- faster_rcnn_models训练模型的地址
评论
共有 条评论