You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
for i in range(self.neg_num):
tmp.append(random.random())
neg_array = self.cs.searchsorted(tmp)
output.append(
np.array([int(i)
for i in neg_array]).astype('int64'))
yield output
负采样得到的 id 用的是采样 list (self.cs) 的 index 值,并且直接作为了输出,没有映射到单词的 word_id,这可能导致模型的负采样逻辑完全出错。
word2vec_reader.py 第 116 行左右
负采样得到的 id 用的是采样 list (self.cs) 的 index 值,并且直接作为了输出,没有映射到单词的 word_id,这可能导致模型的负采样逻辑完全出错。
另外,在取 context 词的时候为什么要对 window_size 的大小做随机呢,是为了 demo 能快速运行吗?
The text was updated successfully, but these errors were encountered: