
LSTM cell forward step (Geron Ch 13, morie.fn hmlstm)
Source:R/geron_w4b_native.R
morie_geron_lstm.RdLSTM cell forward step (Geron Ch 13, morie.fn hmlstm)
Examples
Z <- list(W_i = matrix(0, 2, 2), U_i = matrix(0, 2, 2), b_i = c(0,
0), W_f = matrix(0, 2, 2), U_f = matrix(0, 2, 2), b_f = c(0,
0), W_o = matrix(0, 2, 2), U_o = matrix(0, 2, 2), b_o = c(0,
0), W_g = matrix(0, 2, 2), U_g = matrix(0, 2, 2), b_g = c(0,
0))
morie_geron_lstm(c(0, 0), c(0, 0), c(2, -2), Z)
#> $h_t
#> [1] 0.3807971 -0.3807971
#>
#> $c_t
#> [1] 1 -1
#>
#> $i_t
#> [1] 0.5 0.5
#>
#> $f_t
#> [1] 0.5 0.5
#>
#> $o_t
#> [1] 0.5 0.5
#>
#> $g_t
#> [1] 0 0
#>
#> $estimate
#> [1] 0.5385284
#>
#> $n
#> [1] 2
#>
#> $method
#> [1] "LSTM cell forward step"
#>