Closed weka511 closed 1 year ago
I assume that this is an attempt to calculate log(0), which occurs only if expit() receives an argument -inf, so the inner product of w and c must be infinite. In short, we already have an infinite value among the weights.
I have desk checked the code, and think that the calcs are correct. Since I haven't seen this problem for small eta I plan to close shortly.
Not seen
./word2vec2.py train --N 100000 --tau 90000 ... Iteration= 4426, eta=0.0476, Loss=15260980.49 C:\Users\Weka\nlp\skipgram.py:292: RuntimeWarning: divide by zero encountered in log return - (np.log(expit(self.model.get_product(i_w,i_c_pos))) Iteration= 4451, eta=0.0476, Loss=inf Traceback (most recent call last): File "C:\Users\Weka\nlp\word2vec2.py", line 197, in
optimizer.optimize()
File "C:\Users\Weka\nlp\skipgram.py", line 375, in optimize
raise Exception('Total loss overflow')
Exception: Total loss overflow