Skip to content

Commit dd161e4

Browse files
committed
refine mlpPred.m
1 parent 92c8220 commit dd161e4

1 file changed

Lines changed: 4 additions & 6 deletions

File tree

chapter05/mlpPred.m

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
function y = mlpPred(model, X)
1+
function Y = mlpPred(model, X)
22
% Multilayer perceptron prediction
33
% Input:
44
% model: model structure
@@ -8,9 +8,7 @@
88
% Written by Mo Chen (sth4nth@gmail.com).
99
W = model.W;
1010
L = length(W)+1;
11-
Z = cell(L);
12-
Z{1} = X;
11+
Y = X;
1312
for l = 2:L
14-
Z{l} = sigmoid(W{l-1}'*Z{l-1});
15-
end
16-
y = Z{L};
13+
Y = sigmoid(W{l-1}'*Y);
14+
end

0 commit comments

Comments
 (0)