当前位置:网站首页>Word2vec yyds dry goods inventory
Word2vec yyds dry goods inventory
2022-07-01 14:34:00 【LolitaAnn】
This article is my note sharing , The content mainly comes from teacher Wu Enda's in-depth learning course . [1]
Word2Vec There are two training modes .
- CBOW(Continuous Bag-of-Words Model)
- Skip-gram (Continuous Skip-gram Model)
This article is about skip-grams [2].
We talked about how to get word embedding Of E A method of matrix . The neural network is used for training . Of course, we need to know that method of training , The computational complexity is very large . So is there a simpler way .
Basic model
stay skip-gram In the model, we should establish a supervised learning model .
Here we need to choose a context vocabulary (Content) And a target vocabulary (Target).
Model process :
one-hot→E→word embedding e→softmax→
- First of all, we should start from the vocabulary one-hot vector Starting with .
- We can get one word embedding matrix .
- take word embedding Matrix and one-hot Multiply the vectors to get word embedding vector .
- In this way, the result is sent to softmax in .
- Get the final result
among softmax The calculation formula of is :
- Yes and output t Related parameters , That is, an output word t What is the probability of matching the label .
- There is no offset .
The loss function uses a natural estimate of the negative logarithm .
softmax Then output a 10000 The vector of the dimension . The result is the probability of all possible target words .
Optimizing this model will be much simpler than that neural network we talked about before .
solve softmax Large amount of computation
Look at softmax Calculation formula , We should know that its denominator calculation is very large . Our example vocabulary only 1 ten thousand . The amount of calculation is terrible . If the scale of those vocabularies is 100 Wan? .
One way is to split it evenly . Consider binary search . He won't tell you at once that the final result is 1 Which position in ten thousand words . It tells you in layers .
For example, the first floor tells you , He's in the back 5000 Among them . The second floor tells you , He's ahead 7500 Among them . Then the third layer will tell you layer by layer .

Another method is to count by frequency .
Consider the kind of Harman tree . The higher level is closer to the root node . Of course, there are also those with relatively low mechanical balance , Closer to the root node .

边栏推荐
- Microservice development steps (Nacos)
- Build your own website (21)
- 如何看待国企纷纷卸载微软Office改用金山WPS?
- Research Report on the development trend and competitive strategy of the global pipeline robot inspection camera industry
- Provincial election + noi Part 10 probability statistics and polynomials
- 深度合作 | 涛思数据携手长虹佳华为中国区客户提供 TDengine 强大企业级产品与完善服务保障
- 30 Devops interview questions and answers
- 241. Design priorities for operational expressions
- Vnctf2022 open web gocalc0
- Use of Oracle database objects
猜你喜欢

Phpcms realizes the direct Alipay payment function of orders

sqlilabs less10

Today, with the popularity of micro services, how does service mesh exist?

sqlilabs less10

Open source internship experience sharing: openeuler software package reinforcement test
![[dynamic programming] interval dp:p1005 matrix retrieval](/img/c9/2091f51b905d2c0ebc978dab3d34d3.jpg)
[dynamic programming] interval dp:p1005 matrix retrieval

Scheme of printing statistical information in log

Details of appium key knowledge

One of the data Lake series | you must love to read the history of minimalist data platforms, from data warehouse, data lake to Lake warehouse
![[repair version] imitating the template of I love watching movies website / template of ocean CMS film and television system](/img/fa/15b1cc3a8a723ff34eb457af9f701e.jpg)
[repair version] imitating the template of I love watching movies website / template of ocean CMS film and television system
随机推荐
Pat 1065 a+b and C (64bit) (20 points) (16 points)
sqlilabs less13
Journal MySQL
[零基础学IoT Pwn] 复现Netgear WNAP320 RCE
SWT/ANR问题--如何捕获性能的trace
Leetcode(69)——x 的平方根
原来程序员搞私活这么赚钱?真的太香了
Guess lantern riddles, not programmers still can't understand?
sqlilabs less-8
sqlilabs less9
One of the data Lake series | you must love to read the history of minimalist data platforms, from data warehouse, data lake to Lake warehouse
Après avoir été licencié pendant trois mois, l'entrevue s'est effondrée et l'état d'esprit a commencé à s'effondrer.
Phpcms realizes the direct Alipay payment function of orders
Research Report on the development trend and competitive strategy of the global camera filter bracket industry
MySQL日志
2022 PMP project management examination agile knowledge points (6)
Go integrates logrus to realize log printing
Websocket (simple experience version)
241. 为运算表达式设计优先级
TexStudio使用教程