我正在为我的学校文凭项目开发一个应用程序。
变量存在,但错误是:
???输入参数" esn"未定义。
以下是代码:
trained_esn = esn;
switch trained_esn.learningMode
case 'offline_singleTimeSeries'
% trainInput and trainOutput each represent a single time series in
% an array of size sequenceLength x sequenceDimension
if strcmp(trained_esn.type, 'twi_esn')
if size(trainInput,2) > 1
trained_esn.avDist = ...
mean(sqrt(sum(((trainInput(2:end,:) - trainInput(1:end - 1,:))').^2)));
else
trained_esn.avDist = mean(abs(trainInput(2:end,:) - trainInput(1:end - 1,:)));
end
end
其中定义了esn:
esn = generate_esn(nInputUnits, nInternalUnits, nOutputUnits, ...
'spectralRadius',0.8,...
'inputScaling', ...
[0.1;0.2;0.2;0.2;0.2;0.2;0.2;0.2;0.2;
0.2;0.2;0.2;0.2;0.2;0.2;0.2;0.2;0.2;0.2;0.2;0.2], ...
'inputShift', [0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0;0], ...
'teacherScaling',0.3,'teacherShift',-0.2,
'feedbackScaling', 0, 'type', 'plain_esn');
esn.internalWeights = esn.spectralRadius * esn.internalWeights_UnitSR;