Maps 0-based integer indices to dense vectors via table lookup.
Input: integer matrix or vector of 0-based indices.
Output: float tensor [dim, length(idx)].
Usage
ag_embedding(vocab_size, dim)
Value
An ag_embedding environment
Arguments
vocab_size
Vocabulary size
dim
Embedding dimension
Details
Backward: scatter-add — only the looked-up rows accumulate gradient.