oa::FnLoss::crossEntropyBwd
crossEntropyBwd: gradient w.r.t. logits: (softmax(logits) - onehot(targets)) / batch
Function Documentation
crossEntropyBwd: gradient w.r.t. logits: (softmax(logits) - onehot(targets)) / batch
Parameters
inLogitsconst Matrix &[batch, classes] unnormalized logits
inTargetsconst Matrix &[batch] class indices (UInt8, UInt32, or non-negative Int32)
Returns
MatrixThe declared return value.