Skip to contents

Derivative of Leaky ReLU activation function

Usage

dlReLU(x)

Arguments

x

numeric vector

Value

numeric vector

See also

Other Activation Functions: ELU(), GELU(), PReLU(), ReLU(), SELU(), Swish(), dELU(), dGELU(), dPReLU(), dReLU(), dSELU(), dSwish(), dsoftplus(), lReLU(), softplus()

Examples


dlReLU(c(-1, 0, 1))
#> [1] 0.01 0.01 1.00

# Can use in rxode2 as well

r <- rxode2({r <- dlReLU(time)})
#>  
#>  
#> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
e <- et(c(-1, 0, 1))
rxSolve(r, e)
#> ── Solved rxode2 object ──
#> ── Parameters (value$params): ──
#> # A tibble: 1 × 0
#> ── Initial Conditions (value$inits): ──
#> named numeric(0)
#> ── First part of data (object): ──
#> # A tibble: 3 × 2
#>    time     r
#>   <dbl> <dbl>
#> 1    -1  0.01
#> 2     0  0.01
#> 3     1  1