Another view of Sigmoid function

less than 1 minute read

Sigmoid function (standard logistic function) is defined as

Now, let’s show .

Code for the figure:

sigmoid <- function(x){
	return (1/(1+exp(-x)))
x <- as.matrix(seq(-6, 6, 0.01))
y <- apply(x, 2, sigmoid)
plot(x, y, type='l')
abline(v = 0)
lines(x=c(-2, 0), y=c(sigmoid(-2), sigmoid(-2)), lty=2,col=2,lwd=2)
lines(x=c(-2,-2), y=c(0, sigmoid(-2)), lty=2,col=2,lwd=2)
lines(x=c(2, 0), y=c(sigmoid(2), sigmoid(2)), lty=2,col=4,lwd=2)
lines(x=c(2,2), y=c(0, sigmoid(2)), lty=2,col=4,lwd=2)
text(-0.5, sigmoid(2), expression(sigma(2)))
text(1.25, sigmoid(-2), expression(sigma(-2)==1-sigma(2)))