Book a Demo!
CoCalc Logo Icon
StoreFeaturesDocsShareSupportNewsAboutPoliciesSign UpSign In
hackassin
GitHub Repository: hackassin/Coursera-Machine-Learning
Path: blob/master/Week 3/Programming Assignment - 2/machine-learning-ex2/ex2/sigmoid.m
863 views
1
function g = sigmoid(z)
2
%SIGMOID Compute sigmoid function
3
% g = SIGMOID(z) computes the sigmoid of z.
4
5
% You need to return the following variables correctly
6
g = zeros(size(z));
7
8
% ====================== YOUR CODE HERE ======================
9
% Instructions: Compute the sigmoid of each value of z (z can be a matrix,
10
% vector or scalar).
11
12
g = 1./(1+exp(-z));
13
14
15
% =============================================================
16
17
end
18
19