Created
February 1, 2017 15:59
-
-
Save echo66/28c91deace841010f74edd12c146ac80 to your computer and use it in GitHub Desktop.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
x = -10:0.01:10; | |
function y = logistic(z) | |
y = 1 ./ (1 + e.^(-z)); | |
end | |
function y = logistic_derivative(z) | |
y = logistic(z) .* (1 - logistic(z)); | |
end | |
y1 = logistic(x); | |
dy1 = logistic_derivative(x); | |
y2 = tanh(x); | |
dy2 = 1 - tanh(x).^2; | |
figureplot(x, y1, "-;logistic(z);", x, y2, "-;tanh(z);"); | |
figureplot(x, dy1, "-;logistic derivative;", x, dy2, "-;tanh derivative;"); |
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment