What is the sigmoid function, and what is its use in machine learning's neural networks? In machine learning algorithms, why is sigmoid function used primarily and not functions like tanh(x)? In tanhx for eg. seem to split y-axis evenly and flatten out fast as x approaches +/- infinity. The range being: sigmoid [0-1] and tanh(x) [-1,1].