Cursera: machine learning ex2.

This commit is contained in:
2015-03-01 12:18:13 +04:00
parent 8dcb7d81a8
commit 32f8821b79
15 changed files with 1295 additions and 0 deletions

View File

@@ -0,0 +1,19 @@
function g = sigmoid(z)
%SIGMOID Compute sigmoid functoon
% J = SIGMOID(z) computes the sigmoid of z.
% You need to return the following variables correctly
g = zeros(size(z));
% ====================== YOUR CODE HERE ======================
% Instructions: Compute the sigmoid of each value of z (z can be a matrix,
% vector or scalar).
g = ones(size(z)) ./ (ones(size(z)) + exp(-1*z));
% =============================================================
end