Hello Ziqi and Ayman!
tanh() is a commonly-used differentiable approximation to the
step function, and is sometimes used as an activation function.
(We often call these differentiable approximations “soft” versions
of the functions they approximate.)
Best.
K. Frank