Tanh / Hyperbolic Tangent Activation Function

 

🔵 Tanh / Hyperbolic Tangent Activation Function

The tanh (hyperbolic tangent) function is another important nonlinear activation function used in artificial neural networks.

It is closely related to the sigmoid function, but it has one important advantage: its output is centered around zero.

The tanh function is particularly useful for understanding the evolution from sigmoid-based neural networks to modern activation functions such as ReLU.


🧠 1. What Is the Tanh Function?

The hyperbolic tangent function is defined as:

tanh⁡(z)=ez−e−zez+e−z\boxed{ \tanh(z)=\frac{e^z-e^{-z}}{e^z+e^{-z}} }

It can also be expressed in terms of the sigmoid function:

tanh⁡(z)=2σ(2z)−1\boxed{ \tanh(z)=2\sigma(2z)-1 }

where:

σ(z)=11+e−z\boxed{ \sigma(z)=\frac{1}{1+e^{-z}} }

The output of tanh lies between:

−1<tanh(z)<1​

So, conceptually:

Comments

Popular posts from this blog

Machine Learning PCCST503 Semester5 KTU CS 2024 Scheme - Dr Binu V P

Introduction to Machine Learning (ML)

Distinguishing Machine Learning from Traditional Programming