Take the 2-minute tour ×
Mathematics Stack Exchange is a question and answer site for people studying math at any level and professionals in related fields. It's 100% free, no registration required.

I am trying to program my own activation function for a neural network.

I am trying to do the same thing as for the Bipolar sigmoid function in this example but for the hyperbolic tangent.

This is how its done for the bipolar sigmoid function: $$ f(x) = {2 \over (1 + e^{-\alpha x} ) - 1} $$

$$ f'(x) = {\alpha (1 - f(x) f(x) )\over 2 } $$

With $y = f(x)$ $$ f'(y) = {\alpha (1 - y y )\over 2 } $$

For the hyperbolic tangent $$ f(x) = tanh(x) $$

$$ f'(x) = sech^2(x) $$

$$ f'(y) = ?? $$

How can I find f '(y) ?

share|improve this question

1 Answer 1

up vote 0 down vote accepted

If you mean what I think you mean (turning a derivative into a differential equation basically):

$$f'(x)=sech^2 x = 1 - tanh^2 x = 1- f(x)^2 $$

share|improve this answer

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.

Not the answer you're looking for? Browse other questions tagged or ask your own question.