add comments about matrix dimensions
This commit is contained in:
@@ -41,6 +41,11 @@ void Lookup<InputDataType, OutputDataType>::Forward(
|
||||
|
||||
for (size_t i = 0; i < batchSize; ++i)
|
||||
{
|
||||
//! ith column of output is a vectorized form of a matrix of shape
|
||||
//! (seqLength, embeddingSize) selected as a combination of rows from the
|
||||
//! weights. It is done to ensure that the feature dimension remains beside
|
||||
//! the batch dimension when vectorized form is unpacked for some other
|
||||
//! layer.
|
||||
output.col(i) = arma::vectorise(weights.rows(
|
||||
arma::conv_to<arma::uvec>::from(input.col(i)) - 1));
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user