qrnn (version 2.0.5)

transfer: Transfer functions and their derivatives

Description

The sigmoid, exponential linear elu, and softplus 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, 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)
linear(x)
linear.prime(x)

Arguments

x

numeric vector.

alpha

transition parameter for elu and softplus functions.

Examples

Run this code
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, linear(x), col="green")
lines(x, linear.prime(x), lty=2, col="green")

Run the code above in your browser using DataLab