You can not select more than 25 topics Topics must start with a chinese character,a letter or number, can include dashes ('-') and can be up to 35 characters long.

sigmoid.m 503 B

8 years ago
12345678910111213141516171819
  1. function g = sigmoid(z)
  2. %SIGMOID Compute sigmoid functoon
  3. % J = SIGMOID(z) computes the sigmoid of z.
  4. % You need to return the following variables correctly
  5. g = zeros(size(z));
  6. % ====================== YOUR CODE HERE ======================
  7. % Instructions: Compute the sigmoid of each value of z (z can be a matrix,
  8. % vector or scalar).
  9. %g = 1 ./ (1 .+ e .^ -z);
  10. g = 1.0 ./ (1.0 + exp(-z));%exp(n)-->e的n次方
  11. % =============================================================
  12. end

机器学习

Contributors (1)