Loading...
Implement a token embedding lookup table.
Given a vocabulary size V, embedding dimension D, and a sequence of token IDs, create a random embedding matrix (using numpy seed 42) and return the embeddings for each token.
Input:
Output: The embedding matrix for the input tokens, one row per token, values rounded to 4 decimal places.
5 3 0 2 4
[[ 0.4967 -0.1383 0.6477] [ 0.5426 -0.4634 -0.4657] [-0.2349 0.2767 -0.3539]]