Apply sigmoid function.