Learn R Programming

rkeops (version 2.2.2)

relu: Element-wise ReLU function

Description

Symbolic element-wise ReLU function for LazyTensor objects or standard element-wise ReLU function otherwise.

Usage

relu(x)

Value

See value of relu.default() or relu.LazyTensor()

Arguments

x

input for relu.default() or relu.LazyTensor().

Author

Chloe Serre-Combe, Amelie Vernay

Details

The ReLU function fukushima_cognitron_1975rkeops is defined as follows: relu(x) returns 0 if x < 0, x if x >= 0.

If x is a LazyTensor, see relu.LazyTensor(), else see relu.default().

References

fukushima_cognitron_1975rkeops

See Also

relu.default(), relu.LazyTensor()

Examples

Run this code
if (FALSE) {
# Numerical input
relu(4)
relu(-10:10)
# LazyTensor symbolic element-wise square
x <- matrix(runif(150 * 3), 150, 3) # arbitrary R matrix, 150 rows, 3 columns
x_i <- LazyTensor(x, index = 'i')   # creating LazyTensor from matrix x, 
                                    # indexed by 'i'
ReLU_x <- relu(x_i)                 # symbolic matrix, 150 rows and 3 columns
}

Run the code above in your browser using DataLab