add comments about matrix dimensions

This commit is contained in:
Mrityunjay Tripathi
2020-08-03 12:24:26 +05:30
parent 0e3458f244
commit 345b312c00
@@ -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));
}