Derivatives Parametric ReLU Activation Function
Value
A numeric vector where the derivative(s) of the ELU function has been applied
to each element of x
.
Examples
dPReLU(c(-1, 0, 1, 2), 2)
#> [1] 2 2 1 1
dPReLUa(c(-1, 0, 1, 2), 2)
#> [1] -1 0 0 0
dPReLUa1(c(-1, 0, 1, 2), 2)
#> [1] 1 1 0 0
# Can also be used in rxode2:
r <- rxode2({
r1=dPReLU(time, 2)
r2a=dPReLUa(time, 2)
ra=dPReLUa1(time, 2)
})
#>
#>
#> using C compiler: ‘gcc (Ubuntu 11.4.0-1ubuntu1~22.04) 11.4.0’
e <- et(c(-1, 0, 1, 2))
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: 4 × 4
#> time r1 r2a ra
#> <dbl> <dbl> <dbl> <dbl>
#> 1 -1 2 -1 1
#> 2 0 2 0 1
#> 3 1 1 0 0
#> 4 2 1 0 0