Comments (5)
Uh, I wanted to set the line on padding_idx
to be 0, but in the code it initializes the first line even if padding_idx
is not zero. Would you PR it or should I fix it?
from pytorch-sgns.
@theeluwin Oh, I just do not understand your initialization. I suppose that there must be some reasons which I do not know, so I want to ask about it. And I rewrote a copy of your own code but it doesn't work, do you mind to look at my code help me check the error,thank you for your replay.
from pytorch-sgns.
padding_idx
denotes, literally, a padding index for a padding word. The padding word should have zero vector (usually), so it should be initialized as so.
About your code, I'm not really sure if I can help you but if it's possible, I'll try.
from pytorch-sgns.
Hi @theeluwin, here the padding word you mean is, of course, the "unknown word" right? And is it normal to initialize it by zeros? BTW, thanks for sharing your git. I am a newbie in language stuff and it really helps me a lot! :)
from pytorch-sgns.
@GyeongJoHwang Normally, the "unknown word", or UNK token denotes rare word rather than padding, so making it 0 might be a solution but usually we use random vector or mean vector of all vocabulary. Padding tokens are like, when you want to make some sentences to have equal length (for batch training or so), for example, to make 13-length-ed sentence into 20-length-ed, you should "pad" 7 tokens with, probably zero.
from pytorch-sgns.
Related Issues (14)
- Confused by the loss function. HOT 2
- What‘s the function of <UNK>? HOT 1
- Add requirements.txt
- Bug in the Loss Function HOT 2
- what is a good loss value finally? HOT 1
- Purpose of unks in skipgram function HOT 2
- myConfusion HOT 1
- An error occurred when testing the repo HOT 4
- Using of discard probabilities HOT 2
- Where is Expectation HOT 5
- applying regularisation HOT 1
- Different embeddings for input/output words? HOT 2
- How to ensure that the negative sampled words are not the target word? HOT 1
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from pytorch-sgns.