In [2]:
sigmoid = function(x) {
1 / (1 + exp(-x))
}
x <- seq(-5, 5, 0.01)
plot(x, sigmoid(x), col='blue')
In [3]:
softmax = function(x) {
exp(x) / sum(exp(x))
}
x <- seq(-5, 5, 0.01)
plot(x, softmax(x), col='blue')
In [12]:
relu = function(z) {
pmax(z,0)
}
x <- seq(-5, 5, 0.01)
plot(x, relu(x), col='blue')
In [ ]: