chainer.functions.embed_id¶
-
chainer.functions.
embed_id
(x, W, ignore_label=None)[source]¶ Efficient linear function for one-hot input.
This function implements so called word embedding. It takes two arguments: a set of IDs (words)
x
in \(B\) dimensional integer vector, and a set of all ID (word) embeddingsW
in \(V \times d\) float32 matrix. It outputs \(B \times d\) matrix whosei
-th column is thex[i]
-th column ofW
.This function is only differentiable on the input
W
.Parameters: Returns: Output variable.
Return type: See also