-
Notifications
You must be signed in to change notification settings - Fork 2
/
Copy pathelmlrftest.m
32 lines (26 loc) · 951 Bytes
/
elmlrftest.m
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
function [ er, bad, testing_time ] = elmlrftest( net, x, y, opts )
%ELMLRFTEST Test ELM-LRF
%
%==========================================================================
% Developed based on "cnn" of "DeepLearnToolbox" of rasmusbergpalm on GitHub
% https://github.com/rasmusbergpalm/DeepLearnToolbox
%
%==========================================================================
% ---------<LiuZhi>
% ---------<Xidian University>
% ---------<[email protected]>
% ---------<2015/11/24>
%==========================================================================
%
testing_time = cputime;
%forward
% model
elmlrff = str2func(['@elmlrff_' opts.model]);
net = elmlrff(net, x);
predT = net.h * net.BETA; % (N, K(d-r+1)) * (K(d-r+1),nClasses)
[~, label0] = max(y, [], 2);
[~, label] = max(predT, [], 2);
bad = find(label0 ~= label);
er = numel(bad) / size(y, 1);
testing_time = cputime - testing_time;
end