Sigmoid function in NN

X = [ones(m, 1) X];
temp = X * Theta1';

t = size(temp, 1);
temp = [ones(t, 1) temp];

h = temp * Theta2';
[max_num, p] = max(h, [], 2);

Without Sigmoid function, Training Set Accuracy: 69.620000

 1 X = [ones(m, 1) X];
 2 temp = X * Theta1';
 3 temp = sigmoid(temp);
 4 
 5 t = size(temp, 1);
 6 temp = [ones(t, 1) temp];
 7 
 8 h = temp * Theta2';
 9 h = sigmoid(h);
10 [max_num, p] = max(h, [], 2);

With Sigmoid function, the Training Set Accuracy: 97.520000

原文地址:https://www.cnblogs.com/devai/p/4850548.html