tanh is a rescaled logistic sigmoid function

This confused me for a while when I first learned it, so in case it helps anyone else:

The logistic sigmoid function, a.k.a. the inverse logit function, is

\[ g(x) = \frac{ e^x }{1 + e^x} \]

Its outputs range from 0 to 1, and are often interpreted as probabilities (in, say, logistic regression).

The tanh function, a.k.a. hyperbolic tangent function, is a rescaling of the logistic sigmoid, such that its outputs range from -1 to 1. (There’s horizontal stretching as well.)

\[ tanh(x) = 2 g(2x) - 1 \]

It’s easy to show the above leads to the standard definition \( tanh(x) = \frac{e^x – e^{-x}}{e^x + e^{-x}} \). The (-1,+1) output range tends to be more convenient for neural networks, so tanh functions show up there a lot.

The two functions are plotted below. Blue is the logistic function, and red is tanh.

Screen Shot 2013-10-31 at 4.32.04 PM

This entry was posted in Uncategorized. Bookmark the permalink.

5 Responses to tanh is a rescaled logistic sigmoid function

  1. A person essentially lend a hand to make critically posts I would
    state. That is the first time I frequented your website page and up to now?

    I amazed with the analysis you made to create this actual put up extraordinary.
    Magnificent process!

  2. If like me you’re attempting tto learn a new language then anything
    thaat akes the process easier has actually reached be an advantage.
    I’ve considered many of the tools offered and have actually found to my expense that most of
    the paid ones are virtually useless. The one I use currently is in the general public domain aand workks fantastically well.
    If you’ve any interest in increasing your discovering after that
    whyy not look?

  3. Israel says:

    I see a lot of interesting content on your blog.
    You have to spend a lot of time writing, i know how to
    save you a lot of time, there is a tool that creates unique, google friendly articles in couple of minutes, just type in google – laranita’s free content source

  4. When none of these routines typically work they are forced back to square one and
    spend much of the first few months of the baby’s
    life in misery because they are unable help their child feel better.
    “While we can’t say at this time that weight loss therapy is definitely the solution to this condition, it certainly warrants further research as a treatment. Have your doctor examine you to find out whether your acid reflux condition is due to a disease or due to losing your digestive enzymes as you age or perhaps due to bacteria such as H.

    Here is my web-site :: what foods to avoid with acid reflux

  5. Without protective lenses, your glasses will offer no protection for your eyes at all, which in the long run will create all kinds of problems for you.You deserve some pampering home of the groaning buffet is also a major spa capital.Like with other types of birdbaths, a hanging bird bath also comes in different forms, sizes, styles and material-Ceramic, resin, polo ralph lauren outlet copper, to name just a few.Ask your guests to dress for the time period and if the film is in black and white,

Leave a Reply

Your email address will not be published. Required fields are marked *

You may use these HTML tags and attributes: <a href="" title=""> <abbr title=""> <acronym title=""> <b> <blockquote cite=""> <cite> <code> <del datetime=""> <em> <i> <q cite=""> <strike> <strong>