sigmoid: Sigmoid

View source: R/sigmoid.R

sigmoidR Documentation

Sigmoid

Description

computes sigmoid nonlinearity

Usage

sigmoid(
  x,
  method = c("logistic", "Gompertz", "tanh", "ReLU", "leakyReLU"),
  inverse = FALSE,
  SoftMax = FALSE,
  ...
)

Arguments

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

Examples

# 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)

sigmoid documentation built on June 18, 2022, 5:05 p.m.