Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

About Average #40

Closed
cxncu001 opened this issue Mar 26, 2018 · 2 comments
Closed

About Average #40

cxncu001 opened this issue Mar 26, 2018 · 2 comments

Comments

@cxncu001
Copy link

2.average vectors, to get representation of the sentence

self.sentence_embeddings = tf.reduce_mean(sentence_embeddings, axis=1) # [None,self.embed_size]

When training, we pad all sentences as max sentence length, then tf.reduce_mean(sentence_embeddings, axis=1) means sum/(max sentence length). How could it know the length of each sentence?

Thanks!

@brightmart
Copy link
Owner

after pad a sentence to max length of sentence, max length will be the sentence's actual length.

for the word of pad, we will learn a embedding. suppose it is zeros, then it will have no impact to average

@cxncu001
Copy link
Author

Thanks.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

2 participants