aboutsummaryrefslogtreecommitdiff
path: root/R_LogR/mlclass-ex2/sigmoid.m
diff options
context:
space:
mode:
authorleshe4ka46 <alex9102naid1@ya.ru>2025-12-13 19:41:40 +0300
committerleshe4ka46 <alex9102naid1@ya.ru>2025-12-13 19:41:40 +0300
commit175ac10904d0f31c3ffeeeed507c8914f13d0b15 (patch)
tree671c68a03354c5084470c5cfcfd4fe87aae2aff8 /R_LogR/mlclass-ex2/sigmoid.m
parent72b4edeadeafc9c54b3db9b0961a45da3d07b77c (diff)
linr, logr
Diffstat (limited to 'R_LogR/mlclass-ex2/sigmoid.m')
-rw-r--r--R_LogR/mlclass-ex2/sigmoid.m18
1 files changed, 18 insertions, 0 deletions
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