From 175ac10904d0f31c3ffeeeed507c8914f13d0b15 Mon Sep 17 00:00:00 2001 From: leshe4ka46 Date: Sat, 13 Dec 2025 19:41:40 +0300 Subject: linr, logr --- R_LogR/mlclass-ex2/sigmoid.m | 18 ++++++++++++++++++ 1 file changed, 18 insertions(+) create mode 100644 R_LogR/mlclass-ex2/sigmoid.m (limited to 'R_LogR/mlclass-ex2/sigmoid.m') diff --git a/R_LogR/mlclass-ex2/sigmoid.m b/R_LogR/mlclass-ex2/sigmoid.m new file mode 100644 index 0000000..a79fccd --- /dev/null +++ b/R_LogR/mlclass-ex2/sigmoid.m @@ -0,0 +1,18 @@ +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 -- cgit v1.2.3