GELU activation function
Examples
GELU(c(-2, -1, 0, 1, 2))
#> [1] -0.04550026 -0.15865525 0.00000000 0.84134475 1.95449974
# you can use rxode2 as well
r <- rxode2({
r = GELU(time)
})
#>
#>
#> using C compiler: ‘gcc (Ubuntu 13.3.0-6ubuntu2~24.04) 13.3.0’
et <- et(c(-2, -1, 0, 1, 2))
rxSolve(r, et)
#> ── Solved rxode2 object ──
#> ── Parameters (value$params): ──
#> # A tibble: 1 × 0
#> ── Initial Conditions (value$inits): ──
#> named numeric(0)
#> ── First part of data (object): ──
#> # A tibble: 5 × 2
#> time r
#> <dbl> <dbl>
#> 1 -2 -0.0455
#> 2 -1 -0.159
#> 3 0 0
#> 4 1 0.841
#> 5 2 1.95