1
0
Fork 0

Compute the sigmoid function

master
neingeist 11 years ago
parent d52fa95328
commit efe94282b4

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