From efe94282b4850b9891793eefb956a925d0862248 Mon Sep 17 00:00:00 2001 From: neingeist Date: Mon, 13 Oct 2014 23:14:44 +0200 Subject: [PATCH] Compute the sigmoid function --- ex2/sigmoid.m | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/ex2/sigmoid.m b/ex2/sigmoid.m index aeb7572..043d2de 100644 --- a/ex2/sigmoid.m +++ b/ex2/sigmoid.m @@ -2,14 +2,14 @@ function g = sigmoid(z) %SIGMOID Compute sigmoid functoon % 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)); % ====================== 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));