⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 model_eval.m.svn-base

📁 Bayesian Surprise Toolkit for Matlab T. Nathan Mundhenk, Laurent Itti
💻 SVN-BASE
字号:
%MODEL_EVAL Compute the MSE for model testing
%   [Rval,Pass] = MODEL_EVAL(DATA,E_DATA,RMAX)
%
%   This is part of the model testing suite used to check the model before
%   (or even after) SVN update. It is given the expected data and the
%   actual data and returns the MSE along with a pass fail notation. 
%
%   RVAL is the MSE between the expected return and actaul return
%
%   PASS if the model passes by the margin set in RMAX then this is set to
%   1. Otherwise the test is considered a fail and it returns a 0.
%
%   DATA This should be the output data from the model being tested. 
%
%   E_DATA This should be the EXPECTED data from the model being tested. 
%
%   RMAX This should be a small number. Since there should be some expected
%   floating point error, this should not be 0. However, it should be very
%   small.
%
%
%   See also: model_test.m
%
%   T. Nathan Mundhenk
%   mundhenk@usc.edu

function [Rval,Pass] = model_eval(data,e_data,Rmax)

Rval = sum(sum((data - e_data) .* (data - e_data)));

if Rval > Rmax
    Pass = 0;
    fprintf('TEST FAILED: Result MSE %f\n',Rval);
else
    Pass = 1;
end

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -