relu: A Rectified Linear Unit (ReLU)

Description Usage Arguments Value Author(s) Examples

View source: R/relu.R

Description

pushes negative values to 0 while returns positive values unmodified

Usage

1
relu(v)

Arguments

v

a numeric vector or matrix

Value

the original vector with negative values truncated to zero

Author(s)

Yijun Yang

Examples

1
2
3
4
## Not run: 
relu(c(0, -1, 3, -5, 7))

## End(Not run)

yijunyang/bis557 documentation built on Dec. 21, 2020, 3:06 a.m.