relu: ReLU

Description Usage Arguments Value Author(s) Examples

Description

Calculates the relu fucntion

relu = max(0, x)

Usage

1
2
3
4
5
6
7
## S3 method for class 'modello_number'
relu(x)

## Default S3 method:
relu(x)

relu(x)

Arguments

x

a 'numeric' or a reference object of class 'number'

Value

Returns a 'numeric' or reference object of class 'number'

Author(s)

Filippo Monari

Examples

 1
 2
 3
 4
 5
 6
 7
 8
 9
10
11
12
13
14
15
16
17
18
19
20
modello.init(10, 10, 10, 10)
## For modello_numbers sclars
x1 = number(rnorm(1), scalar=TRUE)
y1 = relu(x1)
print(y1)
print(y1$v)
## For modello_number arrays 
x2 = number(matrix(rnorm(9), 3, 3))
y2 = relu(x2)
print(y2)
print(y2$v)
modello.close()
## For numeric sclars
x1 = rnorm(1)
y1 = relu(x1)
print(y1)
## For numeric arrays
x2 = matrix(rnorm(9), 3, 3)
y2 = relu(x2)
print(y2)

modello documentation built on Feb. 2, 2021, 9:06 a.m.

Related to relu in modello...