oa::ml::matrix::lstm_cell
Apply one LSTM cell update to caller-supplied hidden and cell states. gates_i has shape [batch, 4 * hidden], hidden and cell have [batch, hidden], weight_hh has [4 * hidden, hidden], and an optional recurrent bias has [4 * hidden]. Returns (hidden_next, cell_next). Errors Returns an error unless all values are nonempty same-runtime F32 matrices, shapes agree, hidden size is at most 1024, or runtime recording fails.
Function Documentation
Apply one LSTM cell update to caller-supplied hidden and cell states. gates_i has shape [batch, 4 * hidden], hidden and cell have [batch, hidden], weight_hh has [4 * hidden, hidden], and an optional recurrent bias has [4 * hidden]. Returns (hidden_next, cell_next). Errors Returns an error unless all values are nonempty same-runtime F32 matrices, shapes agree, hidden size is at most 1024, or runtime recording fails.