Package 'sigmoid'

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

Help Index


Gompertz

Description

maps numeric vector using Gompertz function

Usage

Gompertz(x, a = 1, b = 1, c = 1)

Arguments

x

input vector

a

see details

b

see details

c

see details


Inverse Gompertz

Description

maps numeric vector using Gompertz function

Usage

inverse_Gompertz(x)

Arguments

x

input vector Gompertz values


Leaky Rectified Linear Unit

Description

maps numeric vector using leaky ReLU function

Usage

leakyrelu(x)

Arguments

x

input vector


Standard Logistic

Description

maps numeric vector using logistic function

Usage

logistic(x, k = 1, x0 = 0)

Arguments

x

input vector

k

see details

x0

see details


Logit

Description

maps numeric vector using logit function

Usage

logit(x)

Arguments

x

input vector


Rectified Linear Unit

Description

maps numeric vector using ReLU function

Usage

relu(x)

Arguments

x

input vector


ReLU Derivative

Description

Converts output of ReLU function to its derivative.

Usage

relu_output_to_derivative(x)

Arguments

x

vector or ReLU values


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 Derivative

Description

Convert output of sigmoid function to its derivative.

Usage

sigmoid_output_to_derivative(x)

Arguments

x

vector of sigmoid values


SoftMax

Description

SoftMax preprocessing

Usage

SoftMax(x, lambda = 2)

Arguments

x

input vector

lambda

see details


SoftPlus

Description

maps numeric input vector using SoftPlus function

Usage

softplus(x)

Arguments

x

input vector


SoftPlus Derivative

Description

Convert output of SoftPlus function to its derivative.

Usage

softplus_output_to_derivative(x)

Arguments

x

vector of SoftPlus values


Tanh Derivative

Description

Convert output of tanh function to its derivative.

Usage

tanh_output_to_derivative(x)

Arguments

x

vector of tanh values