当前位置:网站首页>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 .

边栏推荐
- Use the npoi package of net core 6 C to read excel Pictures in xlsx cells and stored to the specified server
- 2022-2-15 learning xiangniuke project - Section 4 business management
- C#学习笔记(5)类和继承
- Phpcms realizes the direct Alipay payment function of orders
- JVM performance tuning and practical basic theory part II
- TexStudio使用教程
- How to view the state-owned enterprises have unloaded Microsoft office and switched to Kingsoft WPS?
- sqlilabs less9
- 当主程架构游戏的时候,防止到处调用减少耦合性,怎么开放接口给其他人调用呢?
- 【牛客网刷题系列 之 Verilog快速入门】~ 使用函数实现数据大小端转换
猜你喜欢

sqlilabs less9

Scheme of printing statistical information in log

leetcode622. Design cycle queue (C language)

Play with mongodb - build a mongodb cluster

数据湖系列之一 | 你一定爱读的极简数据平台史,从数据仓库、数据湖到湖仓一体

sqlilabs less10

【商业终端仿真解决方案】上海道宁为您带来Georgia介绍、试用、教程

643. Maximum average number of subarrays I

Microservice development steps (Nacos)
![[R language data science]: common evaluation indicators of machine learning](/img/c8/dbfb041fa72799fae1892fe8ac0050.png)
[R language data science]: common evaluation indicators of machine learning
随机推荐
What "hard core innovations" does Intel have in the first half of 2022? Just look at this picture!
SWT/ANR问题--如何捕获性能的trace
手把手带你入门 API 开发
Basic concepts of programming
博文推荐 | 深入研究 Pulsar 中的消息分块
sqlilabs less9
C 语言进阶
TDengine 连接器上线 Google Data Studio 应用商店
【阶段人生总结】放弃考研,参与到工作中,已经顺利毕业了,昨天刚领毕业证
Pat 1065 a+b and C (64bit) (20 points) (16 points)
Pat 1121 damn single (25 points) set
Oracle-数据库对象的使用
Effet halo - qui dit qu'il y a de la lumière sur la tête est un héros
当主程架构游戏的时候,防止到处调用减少耦合性,怎么开放接口给其他人调用呢?
Distributed dynamic (collaborative) rendering / function runtime based on computing power driven, data and function collaboration
2022 PMP project management examination agile knowledge points (6)
TexStudio使用教程
Research Report on the development trend and competitive strategy of the global ultrasonic scalpel system industry
Realize queue with stack and stack with queue (C language \leetcode\u 232+225)
sqlilabs less13