资源简介
储备池应用,预测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 Server 10.4.x 系列 授权文件
- SourceInsight 4.0.0096破解
- 破解source insight4.00.0096
- SourceInsight 破解版3264
- source insight 3.5win10可以用
- SourceInsight 3.5安装包和序列号,win10可
- Source Insight 4.0.0080破解文件 替换lic
- 3新概念模拟电路-运放电路的频率特性
- STM32F103RC+ADC+DMA多通道采样LCD显示
- 基于STM32RCT6的步进电机驱动程序
- 条码字体barcode128
- 右键属性文件校验插件可同时生成十
- The direction of synaptic plasticity mediated
- vc 柱形图 CBarChart
- ArcGIS Engine最优路径分析
- arcgis engine实现叠加分析
- arcgis 10.1 中文环境安装包
- 地图符号化(ArcEngine)
- 地图浏览(ArcEngine)
- Arcgis 扩展模块
- SSD4 exercise8答案
- delphi 版CRC校验程序
- Source Insight 3.5 配置文件
- irc聊天室
- Design of Analog CMOS Integrated Circuits 拉扎
- Homogenization of Monotone Systems of Non-coer
- EESkill NRF24L01 无线模块用户手册
- 易语言RC4加密解密源码
- shp转cad小工具
- Research on pharmacological effects of lycorin
评论
共有 条评论