阅读背景:

Coursera Machine Learning 第三周 quiz Programming Exercise 2: Logistic Regression

来源:互联网 

sigmoid.m

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 = 1 ./ (1 + exp(-z));




% =============================================================

end
function g = sigmoid(z)
%SIGMOID



你的当前访问异常,请进行认证后继续阅读剩余内容。

分享到: