1
$\begingroup$

I have been trying for a while to understand the dimensionality of embeddings in neural networks and I think that finally things have clicked in my brain. However, I would love to check whether or not my understanding is correct.

  1. Embeddings are an effective way to transform words into vectors, or at least to reduce the dimensionality of the data (essentially the Bag of Words approach does not work well as data is sparse)
  2. If I have a text corpus that contains say 5000 sentences, I could then pad each sentence to a standard size, for example 150, and then use embeddings (possibly the Glove pretrained ones) to get an output with dimensionality of 100. That means that I would have $5000x150x100$ elements.

Is my understanding correct? If so, this means that I can start training my network using mini-batches of say $16x150x100$ elements, the layer after the embedding one could be then a LSTM and so on...

$\endgroup$

2 Answers 2

0
$\begingroup$

Input text data + vocabulary = one-hot representation
One-hot rep + embedding = featurized vectors

  1. The greater significance of Embedding is conversion of non-contextual one-hot representation to contextual representation / featurized representation. The byproduct of this is dimensionality reduction and sparsity reduction.

  2. Your understanding is correct on this.

$\endgroup$
0
$\begingroup$

Both are correct.

To clarify - when training in mini batches, it is more common to do padding after selecting each mini batch. Say in your mini batch of size 16, if the longest sentence is of length 35, you want to pad this mini batch to $16x35x100$.

$\endgroup$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge that you have read and understand our privacy policy and code of conduct.

Not the answer you're looking for? Browse other questions tagged or ask your own question.