oa::FnMatrix::vqEmaUpdate

vqEmaUpdate: EMA codebook update + dead-code reinit (van den Oord 2017). The codebook is NOT gradient-trained; each entry tracks the running mean of encoder outputs assigned to it, and dead codes are revived from live encoder rows. inZe [N,D], inIdx [N] int32 (from vqAssign), ioEmbedSum [K,D], ioClusterSize [K], outCodebook [K,D]. inDecay = EMA γ; inEps = division floor; inDeadThreshold = revive codes whose EMA count falls below it; inSeed = per-step seed; inNormalize rescales each codebook row to unit RMS (cosine VQ).

Function Documentation

void oa::FnMatrix::vqEmaUpdate( const Matrix & inZe, const Matrix & inIdx, Matrix & ioEmbedSum, Matrix & ioClusterSize, Matrix & outCodebook, oa::F32 inDecay, oa::F32 inEps, oa::F32 inDeadThreshold, oa::U32 inSeed, bool inNormalize )
vqEmaUpdate: EMA codebook update + dead-code reinit (van den Oord 2017). The codebook is NOT gradient-trained; each entry tracks the running mean of encoder outputs assigned to it, and dead codes are revived from live encoder rows. inZe [N,D], inIdx [N] int32 (from vqAssign), ioEmbedSum [K,D], ioClusterSize [K], outCodebook [K,D]. inDecay = EMA γ; inEps = division floor; inDeadThreshold = revive codes whose EMA count falls below it; inSeed = per-step seed; inNormalize rescales each codebook row to unit RMS (cosine VQ).

Parameters

inZe
const Matrix &

inIdx
const Matrix &

ioEmbedSum
Matrix &

ioClusterSize
Matrix &

outCodebook
Matrix &

inDecay
oa::F32

inEps
oa::F32

inDeadThreshold
oa::F32

inSeed
oa::U32

inNormalize
bool

Returns

void

The declared return value.