transfer: Transfer functions and their derivatives

transferR Documentation

Transfer functions and their derivatives

Description

The sigmoid, exponential linear elu, softplus, lrelu, and relu functions can be used as the hidden layer transfer function for a nonlinear QRNN model. sigmoid is used by default. The linear function is used as the hidden layer transfer function for linear QRNN models. sigmoid.prime, elu.prime, softplus.prime, lrelu.prime, relu.prime, and linear.prime provide the corresponding derivatives.

Usage

sigmoid(x)
sigmoid.prime(x)
elu(x, alpha=1)
elu.prime(x, alpha=1)
softplus(x, alpha=2)
softplus.prime(x, alpha=2)
logistic(x)
logistic.prime(x)
lrelu(x)
lrelu.prime(x)
relu(x)
relu.prime(x)
linear(x)
linear.prime(x)

Arguments

x

numeric vector.

alpha

transition parameter for elu and softplus functions.

Examples

x <- seq(-10, 10, length=100)
plot(x, sigmoid(x), type="l", col="black", ylab="")
lines(x, sigmoid.prime(x), lty=2, col="black")
lines(x, elu(x), col="red")
lines(x, elu.prime(x), lty=2, col="red")
lines(x, softplus(x), col="blue")
lines(x, softplus.prime(x), lty=2, col="blue")
lines(x, logistic(x), col="brown")
lines(x, logistic.prime(x), lty=2, col="brown")
lines(x, lrelu(x), col="orange")
lines(x, lrelu.prime(x), lty=2, col="orange")
lines(x, relu(x), col="pink")
lines(x, relu.prime(x), lty=2, col="pink")
lines(x, linear(x), col="green")
lines(x, linear.prime(x), lty=2, col="green")

qrnn documentation built on May 29, 2024, 1:27 a.m.