Title: | Sigmoid Functions for Machine Learning |
---|---|
Description: | Several different sigmoid functions are implemented, including a wrapper function, SoftMax preprocessing and inverse functions. |
Authors: | Bastiaan Quast [aut, cre] |
Maintainer: | Bastiaan Quast <[email protected]> |
License: | GPL-3 |
Version: | 2.0.0 |
Built: | 2024-11-04 03:03:17 UTC |
Source: | https://github.com/bquast/sigmoid |
maps numeric vector using Gompertz function
Gompertz(x, a = 1, b = 1, c = 1)
Gompertz(x, a = 1, b = 1, c = 1)
x |
input vector |
a |
see details |
b |
see details |
c |
see details |
maps numeric vector using Gompertz function
inverse_Gompertz(x)
inverse_Gompertz(x)
x |
input vector Gompertz values |
maps numeric vector using leaky ReLU function
leakyrelu(x)
leakyrelu(x)
x |
input vector |
maps numeric vector using logistic function
logistic(x, k = 1, x0 = 0)
logistic(x, k = 1, x0 = 0)
x |
input vector |
k |
see details |
x0 |
see details |
maps numeric vector using logit function
logit(x)
logit(x)
x |
input vector |
maps numeric vector using ReLU function
relu(x)
relu(x)
x |
input vector |
Converts output of ReLU function to its derivative.
relu_output_to_derivative(x)
relu_output_to_derivative(x)
x |
vector or ReLU values |
computes sigmoid nonlinearity
sigmoid( x, method = c("logistic", "Gompertz", "tanh", "ReLU", "leakyReLU"), inverse = FALSE, SoftMax = FALSE, ... )
sigmoid( x, method = c("logistic", "Gompertz", "tanh", "ReLU", "leakyReLU"), inverse = FALSE, SoftMax = FALSE, ... )
x |
numeric vector |
method |
type of sigmoid function |
inverse |
use the inverse of the method (reverses) |
SoftMax |
use SoftMax preprocessing |
... |
arguments to pass on the method |
# create input vector a <- seq(-10,10) # use sigmoid with default standard logistic ( b <- sigmoid(a) ) # show shape plot(b) # inverse hist( a - sigmoid(b, inverse=TRUE) ) # with SoftMax ( c <- sigmoid(a, SoftMax=TRUE) ) # show difference hist(b-c)
# create input vector a <- seq(-10,10) # use sigmoid with default standard logistic ( b <- sigmoid(a) ) # show shape plot(b) # inverse hist( a - sigmoid(b, inverse=TRUE) ) # with SoftMax ( c <- sigmoid(a, SoftMax=TRUE) ) # show difference hist(b-c)
Convert output of sigmoid function to its derivative.
sigmoid_output_to_derivative(x)
sigmoid_output_to_derivative(x)
x |
vector of sigmoid values |
SoftMax preprocessing
SoftMax(x, lambda = 2)
SoftMax(x, lambda = 2)
x |
input vector |
lambda |
see details |
maps numeric input vector using SoftPlus function
softplus(x)
softplus(x)
x |
input vector |
Convert output of SoftPlus function to its derivative.
softplus_output_to_derivative(x)
softplus_output_to_derivative(x)
x |
vector of SoftPlus values |
Convert output of tanh function to its derivative.
tanh_output_to_derivative(x)
tanh_output_to_derivative(x)
x |
vector of tanh values |