
Peephole LSTM cell (Geron Ch 15, morie.fn grpels)
Source:R/geron_train_native.R
morie_geron_peephole_lstm_cell.Rdf and i peep at c_{t-1}, o peeps at the NEW c_t, g has no peephole;
the U vectors are diagonal.
Usage
morie_geron_peephole_lstm_cell(
x_t,
h_prev,
c_prev,
Wf,
Wi,
Wg,
Wo,
Uf,
Ui,
Uo,
bf,
bi,
bg,
bo
)Examples
x_t <- c(0.5, -0.1)
h_prev <- c(0.2, 0.3); c_prev <- c(0.1, 0.1)
W <- matrix(0.1, 2, 4); U <- rep(0.1, 2); b <- rep(0, 2)
morie_geron_peephole_lstm_cell(x_t, h_prev, c_prev,
Wf = W, Wi = W, Wg = W, Wo = W,
Uf = U, Ui = U, Uo = U,
bf = b, bi = b, bg = b, bo = b)
#> $h
#> [1] 0.05212458 0.05212458
#>
#> $c
#> [1] 0.09961889 0.09961889
#>
#> $f
#> [1] 0.5249792 0.5249792
#>
#> $i
#> [1] 0.5249792 0.5249792
#>
#> $g
#> [1] 0.08975778 0.08975778
#>
#> $o
#> [1] 0.5249697 0.5249697
#>
#> $estimate
#> [1] 0.05212458 0.05212458
#>
#> $n
#> [1] 2
#>