Skip to contents

f 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
)

Arguments

x_t, h_prev, c_prev

State vectors.

Wf, Wi, Wg, Wo

(H, H + n) gate weights on [h_prev, x_t].

Uf, Ui, Uo

Length-H diagonal peepholes.

bf, bi, bg, bo

Length-H biases.

Value

List with h, c, f, i, g, o.

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
#>