Learn R Programming

ggmlR (version 0.6.1)

nn_lstm_step: Build one LSTM step

Description

Build one LSTM step

Usage

nn_lstm_step(
  ctx,
  x_t,
  h_t,
  c_t,
  W_gates,
  U_gates,
  b_gates,
  units,
  act_cell,
  act_rec
)

Value

list(h = new_h, c = new_c)

Arguments

ctx

ggml compute context

x_t

Input at this step: tensor [input_size, N]

h_t

Previous hidden state: tensor [units, N]

c_t

Previous cell state: tensor [units, N]

W_gates

[input_size, 4*units]

U_gates

[units, 4*units]

b_gates

[4*units]

units

Integer

act_cell

Activation name for cell gate (tanh by default)

act_rec

Activation name for i/f/o gates (sigmoid by default)