-
Notifications
You must be signed in to change notification settings - Fork 2
/
costALL.m
53 lines (37 loc) · 1.03 KB
/
costALL.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
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
function out = costALL(in, net, inputs, targets)
%
net = setx(net, in');
%net = setwb(net, x'); new version
% To evaluate the ouputs based on the given
% weights and biases vector
%y = net(inputs);
% X = size(getx(net))
%
%
% b = net.b
% size(b)
% iw = net.IW
% size(iw)
% lw = net.LW
% size(lw)
% net.numInputs
% pause;
y = sim(net,inputs);
%%%%%%%%%%%MSE cost function%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
mse_calc= sum((y-targets).^2)/length(y);
out=mse_calc;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
% [c,cm,ind,per] = confusion(targets,y);
% Acc= 1- (cm(1,1)+cm(2,2))/(cm(1,1)+cm(1,2)+cm(2,1)+cm(2,2));
% out=Acc;
%[X,Y,T,AUC] = perfcurve(targets,y,'1');
%%%%%%%%%%%AUC cost function%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%k=round(y');
%[AUC2] = 1-colAUC(k,targets','1' ,'abs', false);
%out = 1-AUC2;
%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%%
%k=round(y');
%[AUC] = fastAUC(targets',k,1);
%out = 1- colAUC(k, targets');
%out = 1-colAUC( k, targets','Wilcoxon', 'abs', false);
%out=mse_calc;