compute_error.m
来自「回声状态神经网络(ESN)是一种性能优异的递归神经网络」· M 代码 · 共 40 行
M
40 行
function err = compute_error(estimatedOutput, correctOutput)% Computes the NRMSE between estimated and correct ESN outputs.% % input arguments:% estimatedOutput: array of size N1 x outputDimension, containing network% output data. Caution: it is assumed that these are un-rescaled and% un-shifted, that is, the transformations from the original data format% via esn.teacherScaling and esn.teacherShift are undone. This happens% automatically when the estimatedOutput was obtained from calling% test_esn.%% correctOutput: array of size N2 x outputDimension, containing the% original teacher data. %% output:% err: a row vector of NRMSE's, each corresponding to one of the output% dimensions.%% If length(correctOutput) > length(estimatedOutput), the first% elements from correctOutput are deleted. This accounts for cases where% some (nForgetPoints many) initial transient data points were cancelled% from estimatedOutput, as occurs in calls to test_esn.%% Version 1.0, June 6, 2006, H. Jaeger% Copyright: Fraunhofer IAIS 2006 / Patents pending nEstimatePoints = length(estimatedOutput) ; nForgetPoints = length(correctOutput) - nEstimatePoints ; correctOutput = correctOutput(nForgetPoints+1:end,:) ; correctVariance = var(correctOutput) ; meanerror = sum((estimatedOutput - correctOutput).^2)/nEstimatePoints ; err = (sqrt(meanerror./correctVariance)) ;
⌨️ 快捷键说明
复制代码Ctrl + C
搜索代码Ctrl + F
全屏模式F11
增大字号Ctrl + =
减小字号Ctrl + -
显示快捷键?