JudyYe / zero-shot-gcn

Zero-Shot Learning with GCN (CVPR 2018)
MIT License
917 stars 178 forks source link

Problems of obtain_word_embedding #2

Closed ruotianluo closed 6 years ago

ruotianluo commented 6 years ago
  1. https://github.com/JudyYe/zero-shot-gcn/blob/master/src/tools/obtain_word_embedding.py#L110 Here should raise an error if word_vectors doesn't have the key

  2. https://github.com/JudyYe/zero-shot-gcn/blob/master/src/tools/obtain_word_embedding.py#L51 The provided embedding is not normalized.

JudyYe commented 6 years ago

Hi,

  1. we return zeros but do not include it when averaging. https://github.com/JudyYe/zero-shot-gcn/blob/master/src/tools/obtain_word_embedding.py#L39

  2. In our experiment, there is little difference in the performance between normalized and unnormalized one.

ruotianluo commented 6 years ago

If you don't raise error, current code will never run below https://github.com/JudyYe/zero-shot-gcn/blob/master/src/tools/obtain_word_embedding.py#L76

which leads to almost half embeddings to be empty.

At least, I've checked, if the two problems I pointed out are fixed, then the generated embedding is almost identical to the provided embedding (only tow rows don't match).

JudyYe commented 6 years ago

You are right. I just fixed it... Thank you for pointing out.