oa::FnMatrix::rnnCellPointwiseBwd

rnnCellPointwiseBwd: fused vanilla-RNN pointwise backward. Returns gradients w.r.t. gatesI and gatesH (both equal to dL/da). inGatesI is the whole-sequence [B*T, H] projection; inTimeOffset/inBatchStride select this timestep's rows so dGatesI is scattered into the full buffer (zeros elsewhere).

Function Documentation

RnnCellPointwiseBwdResult oa::FnMatrix::rnnCellPointwiseBwd( const Matrix & inGatesI, const Matrix & inGatesH, const Matrix & inGradOutput, oa::I32 inHiddenSize, oa::U32 inTimeOffset = 0, oa::U32 inBatchStride = 1 )
rnnCellPointwiseBwd: fused vanilla-RNN pointwise backward. Returns gradients w.r.t. gatesI and gatesH (both equal to dL/da). inGatesI is the whole-sequence [B*T, H] projection; inTimeOffset/inBatchStride select this timestep's rows so dGatesI is scattered into the full buffer (zeros elsewhere).

Parameters

inGatesI
const Matrix &

inGatesH
const Matrix &

inGradOutput
const Matrix &

inHiddenSize
oa::I32

inTimeOffset
oa::U32

Default: 0

inBatchStride
oa::U32

Default: 1

Returns

RnnCellPointwiseBwdResult

The declared return value.