since i is a randomly chosen index (as in L211: auto i = *ip;), isn't decrementing rate in L255 based on this condition error-prone?
Furthermore, since "rate" is a shared variable across threads, shouldn't this be protected by a locking mechanism to avoid race condition.
L448: loss[i] /= negSearchLimit;
shouldn't this be: loss[i] /= num_negs[i] since only num_negs[i] are accounted for in updating loss[i]. Or, perhaps loss[i] /= j since we may do an early break in L441.
model.cpp