A strategy to quantify embedding layer
Posted wevolf
tags:
篇首语:本文由小常识网(cha138.com)小编为大家整理,主要介绍了A strategy to quantify embedding layer相关的知识,希望对你有一定的参考价值。
A strategy to quantify embedding layer
Basic idea
Embedding is mainly in the process of word pre-training. Two embedding methods, word2vec and GloVe, are commonly used. Generally speaking, the calculation matrix size of embedding is (V imes h) where, (V) is the size of the one-hot vector, (h) is the size of the vector after embedding. For a slightly larger corpus, the parameters of this process are very large, the main reason is that the (V) is too large. The main idea is to not use one-hot vector to represent words, but to use a code (C_w) to represent, the way to express is:
That is, the dimension of the word becomes the (M) dimension, where (C_w^i in [1,K]) , Therefore, (C_w^i) can essentially be regarded as a one-hot vector of (K) dimension, and (C_w) is a collection of one-hot vectors. At this time, if we want to embedding the word vector C, we need a matrix, which is (E_1, E_2, dots, E_M).
For example
if we have (C_{dog} = (3, 2, 4, 1)) and (C_{dogs} = (3, 2, 4, 2)) , in this condition, (K = 4) and (M=4), (E_1 = {e_{11}, e_{12}, e_{13}, e_{14}}) (E_2 = {e_{21}, e_{22}, e_{23}, e_{24}}) and (dots) (E_4) , Among them, we need to know that the dimension of (e_{ij}) is (1 imes H) , and the process of embedding is :
So the matrix of the embedding process is (M imes K imes h)
以上是关于A strategy to quantify embedding layer的主要内容,如果未能解决你的问题,请参考以下文章
Introduction to Mathematical Thinking - Week 6 - Proofs with Quantifieers
spring.jackson.property-naming-strategy
25 Places To Find Quantitative Trading Strategies
VMTF(variable move-to-front )strategy学习