oa::FnLoss::crossEntropyBwd

crossEntropyBwd: gradient w.r.t. logits: (softmax(logits) - onehot(targets)) / batch

Function Documentation

Matrix oa::FnLoss::crossEntropyBwd( const Matrix & inLogits, const Matrix & inTargets )
crossEntropyBwd: gradient w.r.t. logits: (softmax(logits) - onehot(targets)) / batch

Parameters

inLogits
const Matrix &

[batch, classes] unnormalized logits

inTargets
const Matrix &

[batch] class indices (UInt8, UInt32, or non-negative Int32)

Returns

Matrix

The declared return value.