ActFunc: Activation function of neuron

View source: R/ActFunc.R

ActFuncR Documentation

Activation function of neuron

Description

Evaluate activation function of a neuron

Usage

ActFunc(type = "sigmoid", ...)

Arguments

type

character name of the activation function

...

extra arguments needed to calculate the functions

Value

numeric output of the neuron

References

Pizarroso J, Portela J, Muñoz A (2022). NeuralSens: Sensitivity Analysis of Neural Networks. Journal of Statistical Software, 102(7), 1-36.

Examples

# Return the sigmoid activation function of a neuron
ActivationFunction <- ActFunc("sigmoid")
# Return the tanh activation function of a neuron
ActivationFunction <- ActFunc("tanh")
# Return the activation function of several layers of neurons
actfuncs <- c("linear","sigmoid","linear")
ActivationFunctions <- sapply(actfuncs, ActFunc)

NeuralSens documentation built on July 9, 2023, 6:18 p.m.