activate: Neuron Activation Function

Description Usage Arguments Examples

Description

activation function for each neuron node, we provide the popular activation functions including 'sigmoid', 'tanh', etc.

Usage

1
activate(x, funName)

Arguments

x

input value to the activation function

funName

This package provides the most popular activation functions which can be used by setting the funName parameter to the following strings: 'sigmoid', 'tanh'.

'sigmoid' sigmoid function 1/(1 + exp(-x)).

'tanh' tanh is the hyperbolic tangent function equal to (exp(x) - exp(-x)) / (exp(x) + exp(-x)).

Examples

1
2
3
x <- c(-5:5)
y1 <- activate(x, funName = 'sigmoid')
y2 <- activate(x, funName = 'tanh')

Example output



nnetpredint documentation built on May 2, 2019, 12:35 p.m.