oa::RnnCell
/ Rnn — vanilla Elman recurrent module. h_new = tanh( W_ih x + b_ih + W_hh h + b_hh ) Mirrors the Gru / GruCell API 1:1 (zeroState / step / forward, stacked layers) so the two recurrent modules are interchangeable in a model. Like the GRU it fuses its pointwise tail (Add + Tanh) into one RnnCellPointwise kernel. The two Linear projections stay separate dispatches; since oa::FnMatrix::Linear is pure dispatch, each needs a manual grad-node attach — see AttachLinearGrad in Rnn.cpp.
Inheritance
public Module
Public Methods
Constructor & Destructor Documentation
Public Method Documentation
No public source comment is attached to this declaration.
Parameters
inInputconst oa::Matrix &—
Returns
oa::MatrixThe declared return value.
split projections so Rnn can hoist the (recurrence-free) input projection out of the timestep loop into one batched GEMM. inputProjection: gi = Linear(x, W_ih, b_ih) for any row count → [*, H]. stepWithGi: consumes a precomputed gi [B*T, H] at row offset timeOffset and runs only the recurrent gh = Linear(h, W_hh) + fused tanh pointwise (no per-step Slice).
Parameters
inInputconst oa::Matrix &—
Returns
oa::MatrixThe declared return value.
No public source comment is attached to this declaration.
Returns
oa::I32The declared return value.
No public source comment is attached to this declaration.
Parameters
inInputconst oa::Matrix &—
inHiddenconst oa::Matrix &—
Returns
oa::MatrixThe declared return value.
No public source comment is attached to this declaration.
Parameters
inGiconst oa::Matrix &—
inHiddenconst oa::Matrix &—
inTimeOffsetoa::U32Default: 0
inBatchStrideoa::U32Default: 1
Returns
oa::MatrixThe declared return value.
No public source comment is attached to this declaration.
Parameters
inBatchoa::I32—
Returns
oa::MatrixThe declared return value.